View previous topic :: :: View next topic
|
Author |
Message |
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
Hello All,
I have to create a JCL which does the following function.
I have to copy record 1-60 , 121-180,241-300 etc... records of a file and to another file using a JCL. (it means we have to omit 61-120,181-240 etc..)
The number of records in the input file will vary.
Please help to achive this
In SORT which variable holds the record count. If I know record count I can use REPRO SKIP (record count - 60) to do my function. |
|
Back to top |
|
 |
|
|
Bill Woodger
DFSORT Moderator
Joined: 09 Mar 2011 Posts: 7314
|
|
|
|
See if OUTFIL SAMPLE= does what you want. If not, describe it better, with some example input and expected output. |
|
Back to top |
|
 |
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
Bill Woodger wrote: |
See if OUTFIL SAMPLE= does what you want. If not, describe it better, with some example input and expected output. |
Sure
Example : Please find the below example.In this example i want retrive alternate 2 records
input
---------------
SARAVANAN
RAJA
RAM
RAVI
KUMAR
MOHAN
VISHNU
MANI
output :
----------
SARAVANAN
RAJA
KUMAR
MOHAN |
|
Back to top |
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8763 Location: Welsh Wales
|
|
|
|
You could use SPLITBY to get contiguous groups of 60 records |
|
Back to top |
|
 |
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
expat wrote: |
You could use SPLITBY to get contiguous groups of 60 records |
Thanks for your reply.Actually my requirement is to split only two files.but the record should be store alternate 60 records.As per the the above example 2 records.Acutally my file have 7000 lines.I want to split alternative 60 records in a single files |
|
Back to top |
|
 |
Bill Woodger
DFSORT Moderator
Joined: 09 Mar 2011 Posts: 7314
|
|
|
|
Now I'm even less clear what you want.
Did you try with OUTFIL SAMPLE=(120,60) (or 4,2 for your sample)?
Have you got one output file or two/more? |
|
Back to top |
|
 |
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
Bill Woodger wrote: |
Now I'm even less clear what you want.
Did you try with OUTFIL SAMPLE=(120,60) (or 4,2 for your sample)?
Have you got one output file or two/more? |
Thanks Bill
It working fine using the OUTFIL SAMPLE=(120,60)..
If we want to store two output file means ,what can we give ?
As per the above example
---------------
Output file 1
--------------
SARAVANAN
RAJA
KUMAR
MOHAN
Output file 2
-------------
RAM
RAVI
VISHNU
MANI |
|
Back to top |
|
 |
Bill Woodger
DFSORT Moderator
Joined: 09 Mar 2011 Posts: 7314
|
|
|
|
You can look at SPLIT and friends in the manual. To extend the example with SAMPLE you could use a second, named, OUTFIL with SAVE. |
|
Back to top |
|
 |
|