JUNK CHARACTERS WHILE USING OUTREC



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

JUNK CHARACTERS WHILE USING OUTREC

Postby MAINFRAME GURU » Thu Jul 16, 2009 3:09 am

Hi Guys,

This is the input file (which has Book #, Book name and Price):

1001 MATH  200
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)                           
/*                                                             
//*                                                             


When I executed the above code then I got the below mentioned output :

1001MATH .......................................................................
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
MAINFRAME GURU
 
Posts: 18
Joined: Fri Jul 10, 2009 8:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JUNK CHARACTERS WHILE USING OUTREC

Postby Frank Yaeger » Thu Jul 16, 2009 4:44 am

//           DCB=(BLKSIZE=8000,LRECL=80,RECFM=FB)               
//SYSIN    DD *                                                 
    SORT FIELDS=(1,4,CH,A)                                     
    OUTREC BUILD=(1,4,6,5)           


You got EXACTLY what you asked for.

1,4,6,5 will put input positions 1-4 in output positions 1-4 and input positions 6-10 in output positions 5-9.
LRECL=80 for the SORTOUT DD tells DFSORT to pad the rest of the bytes with binary zeros (those are your junk characters).

You can keep the space between the fields by using 1,10, or X or 1X or 6:. You can get rid of the junk characters by using 80:X to get blanks instead of binary zeros. So you can use:

  OUTREC BUILD=(1,10,80:X)


or

   OUTREC BUILD=(1,4,X,6,5,80:X)


or

   OUTREC BUILD=(1,4,6:6,5,80:X)


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: JUNK CHARACTERS WHILE USING OUTREC

Postby MAINFRAME GURU » Thu Jul 16, 2009 11:27 am

Thanks Frank for your help!!!

I have already started reading above mentioned book...

Again thanks for mentioning about the books....
MAINFRAME GURU
 
Posts: 18
Joined: Fri Jul 10, 2009 8:41 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post