Page 2 of 2

Re: Sort File

PostPosted: Wed Dec 07, 2011 2:13 am
by Vineet
Yes No Space for Position 172,2. Its having Value like 16,19,20.... . No 'C' Character.

Re: Sort File

PostPosted: Wed Dec 07, 2011 2:46 am
by skolusu
vineet wrote:Yes No Space for Position 172,2. Its having Value like 16,19,20.... . No 'C' Character.


I wouldn't believe it unless I see it. Anyway I asked you another question about what the error was and what was that you corrected?

Run this job as is and show me output as well as the complete sysout

//STEP0100 EXEC PGM=SORT       
//SYSOUT   DD SYSOUT=*         
//SORTIN   DD  DSN=Your input FB 1200 byte fileB,DISP=SHR               
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                           
  INREC BUILD=(1,6,X,172,2,12:C'001')     
  SORT FIELDS=(1,9,CH,A),EQUALS           
  SUM FIELDS=(12,3,ZD)                     
  OUTFIL ENDREC=20                       
//*                                       

Re: Sort File

PostPosted: Wed Dec 07, 2011 4:18 am
by BillyBoyo
Vineet wrote:I am Getting Required O/P, I rectified my error. Thanks for Help. but I am getting one Extra Character 'C' Please Refer below. Here 16 is the Actual Value appearing in File B Position 172,2. Regarding C I am not Sure. How To Remove C.

0000000009 T     BOGO                      16
0000000009 T     Promoted Price            16
0000000001 J     Cents Off                C 
0000000001 J     Cents Off                C 
0000000001 J     Cents Off                C 
0000000001 J     Cents Off                C 
0000000001 J     Cents Off                C 
0000000001 J     Cents Off                C


If I put your data inside the Code tags, the "C" does not line up with the value of 16. If your spacing is accurate, it is not from File B 172,2, but is the last original character of File A. Did you check there?