VENQUET
New User
Joined: 04 May 2006 Posts: 8
|
|
|
|
My requirement is I have 5 fields in the file. The third field is declared as 9(1). That field can have value from 0 to 9. but I have to extract all record which have 1,2,3,....9 in that field and I need to write in a seperate file. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use the following DFSORT job to include only the '1'-'9' records. Just replace p with the starting position of your 9(1) field.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INCLUDE COND=(p,1,SS,EQ,C'123456789')
/*
|
Alternatively, if you really just want to omit the '0' records, you can use this OMIT statement:
Code: |
OMIT COND=(p,1,CH,EQ,C'0')
|
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:
Use [URL] BBCode for External Links |
|