Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Copy the alternate count of records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 72
Location: Chennai

PostPosted: Wed Nov 13, 2013 2:58 pm    Post subject: Copy the alternate count of records
Reply with quote

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
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Nov 13, 2013 3:06 pm    Post subject: Reply to: Copy the alternate count of records
Reply with quote

See if OUTFIL SAMPLE= does what you want. If not, describe it better, with some example input and expected output.
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 72
Location: Chennai

PostPosted: Wed Nov 13, 2013 3:08 pm    Post subject: Re: Reply to: Copy the alternate count of records
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Nov 13, 2013 5:53 pm    Post subject:
Reply with quote

You could use SPLITBY to get contiguous groups of 60 records
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 72
Location: Chennai

PostPosted: Wed Nov 13, 2013 7:53 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Nov 13, 2013 7:57 pm    Post subject: Reply to: Copy the alternate count of records
Reply with quote

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
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 72
Location: Chennai

PostPosted: Wed Nov 13, 2013 8:16 pm    Post subject: Re: Reply to: Copy the alternate count of records
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Nov 13, 2013 8:40 pm    Post subject: Reply to: Copy the alternate count of records
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us