vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Wed Jan 02, 2008 12:43 am Post subject: Re: SORT query |
|
|
mfsrini,
The below code will give you the desired results.
DFSORT solution:
Code: | //STEP01 EXEC PGM=ICEMAN
//SORTIN DD *
ABC12345
23456
34567
45678
56789
67890
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(1,3,CH,EQ,C'ABC')
OUTFIL TRAILER1=('TOTAL NUMBER OF RECORDS =',COUNT)
/* |
SORTOUT:
Code: | 23456
34567
45678
56789
67890
TOTAL NUMBER OF RECORDS = 5 |
If you dont need the detail records then use the following
Code: |
//CTRCDS EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC12345
23456
34567
45678
56789
67890
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OMIT COND=(1,3,CH,EQ,C'ABC')
OUTFIL NODETAIL,REMOVECC,
TRAILER1=('COUNT WITHOUT HEADER:',COUNT=(M11,LENGTH=8))
/*
|
SORTOUT:
Code: | COUNT WITHOUT HEADER:00000005 |
|
|