Page 1 of 1

DFSORT by String

PostPosted: Wed Nov 16, 2011 9:16 am
by coldplay1991
I tried this but wont work.

//SYSIN     DD *                         
    SORT FIELDS=COPY                     
     INCLUDE COND=(9,8,CH,EQ,C'JOE0015')
/*                                       


Any other ways to DFSORT by String

Re: DFSORT by String

PostPosted: Wed Nov 16, 2011 10:26 am
by dick scherrer
Hello,

Stop posting "it didn't work". These too will now be locked / deleted if they are posted again.

You need to post the info generated by the run so we can see the problem.

Re: DFSORT by String

PostPosted: Wed Nov 16, 2011 11:56 pm
by Frank Yaeger
Coldplay,

Sigh. Didn't work how? If I run this DFSORT job:

//S1 EXEC PGM=SORT                               
//SYSOUT DD SYSOUT=*                             
//SORTIN DD *                                   
1234567<JOE0015 >ABC                             
1234567<JOE0016 >ABC                             
1111111<JOE0015 >CDE                             
1234567<JOE0015A>XYZ                             
//SORTOUT DD SYSOUT=*                           
//SYSIN     DD *                                 
    SORT FIELDS=COPY                             
    INCLUDE COND=(9,8,CH,EQ,C'JOE0015')         
/*     


SORTOUT, as expected, has:

1234567<JOE0015 >ABC       
1111111<JOE0015 >CDE       


So if it "won't work", there's something you're not telling us like:

1) Your input file is VB, not FB.
2) You want to look for 7 characters containing 'JOE0015' rather than 8 characters containing 'JOE0015 ' (trailing blank)
3) Something else

If you need more specific help, show an example of your input records, expected output records and your complete JES log for your run, and explain what you mean by "it didn't work".