View previous topic :: View next topic
|
Author |
Message |
raghavmcs
Active User
Joined: 14 Jul 2005 Posts: 105
|
|
|
|
Dear Experts,
I am in a situation where I have to do the selective copy of record in file like as follows
a)The output file should be having the 1,3,5,7.....series like records copied from input file.
The input file lenght is 133 and I knw the record count in file...
Please suggest as I was not able to think with what search string I should search in this forum to see if something have already been discussed!!
Thanks |
|
Back to top |
|
|
raghavmcs
Active User
Joined: 14 Jul 2005 Posts: 105
|
|
|
|
Just to add this is a flat file... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
1,3,5,7 would be every second record (or every odd record), not every third record. You could use a DFSORT job like the following to do that:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL SAMPLE=2
/*
|
|
|
Back to top |
|
|
raghavmcs
Active User
Joined: 14 Jul 2005 Posts: 105
|
|
|
|
Frank,
Thanks for putting the solution.
The answer for your question would be I need every odd record(1,3,5..) in the output file,thanks |
|
Back to top |
|
|
raghavmcs
Active User
Joined: 14 Jul 2005 Posts: 105
|
|
|
|
Dear Frank,
I tried your post and it gave me the result which I wanted,thanks
I was not knowing about this function:-( |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I was not knowing about this function |
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:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
|