|
View previous topic :: View next topic
|
| Author |
Message |
xknight
Active User

Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
My requirement is to split the source file to three files.
| Code: |
INPUT FILE:
123456789
ATEST123
BTEST345
CTEST567 |
I am splitting the file based on the condition below,
| Code: |
| //OUT1 DD DSN=OUTPUT DATASET |
| Code: |
//SYSIN DD *
OPTION COPY
OUTFIL INCLUDE=(1,1,CH,EQ,'A',AND,
6,3,CH,EQ,'123,OR,
1,1,CH,EQ,'B',AND,
6,3,CH,EQ,'345),FNAMES=OUT |
I Want to retrieve the record "CTEST567" which may not be known to me
it is same as "WHEN OTHER" condition in evaluate. Is it possible to retrieve the unmatched records while splitting the files.
Kindly advise on this. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
xavierrajnaveen,
Use the Parm 'SAVE' which specifies that OUTFIL input records not included by STARTREC, ENDREC, SAMPLE, INCLUDE or OMIT for any other OUTFIL group are to be included in the data sets for this OUTFIL group.
| Code: |
//STEP0250 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ATEST123
BTEST345
CTEST567
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=OUT1,
INCLUDE=((1,1,CH,EQ,C'A',AND,6,3,CH,EQ,C'123'),OR,
(1,1,CH,EQ,C'B',AND,6,3,CH,EQ,C'345'))
OUTFIL FNAMES=OUT2,SAVE
//* |
Out1 will have the first 2 records and OUT2 will have the last record. |
|
| Back to top |
|
 |
xknight
Active User

Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Skolusu,
That is brilliant and very much useful.
Thank you very much for your advise and time!!!
 |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|