This is the input file (which has Book #, Book name and Price):
1001 MATH 200
1002 ENG 100
1002 ENG 100
This input file's LRECL is 80. I am using the below code to keep only Book # and Book name.
//STEP2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XYZ.TEST2.ISORT,DISP=SHR
//SORTOUT DD DSN=XYZ.TEST2.OSORT,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE),
// DCB=(BLKSIZE=8000,LRECL=80,RECFM=FB)
//SYSIN DD *
SORT FIELDS=(1,4,CH,A)
OUTREC BUILD=(1,4,6,5)
/*
//*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XYZ.TEST2.ISORT,DISP=SHR
//SORTOUT DD DSN=XYZ.TEST2.OSORT,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE),
// DCB=(BLKSIZE=8000,LRECL=80,RECFM=FB)
//SYSIN DD *
SORT FIELDS=(1,4,CH,A)
OUTREC BUILD=(1,4,6,5)
/*
//*
When I executed the above code then I got the below mentioned output :
1001MATH .......................................................................
1002ENG .......................................................................
1002ENG .......................................................................
Here I am not getting the space in b/w book # and book name... Moreover I am getting the junk characters after 11th column.
I used below code to insert space
OUTREC BUILD=(1,4,1X,6,5)
Is there anyway other way to get the spaces between the book # and book name other than above mentioned code... Also can anyone please tell me how can I remove the junk characters?
Regards,
Guru