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
 

 

REGARDING Copying the records

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

New User


Joined: 17 Aug 2005
Posts: 30

PostPosted: Wed Dec 21, 2005 1:05 pm    Post subject: REGARDING Copying the records
Reply with quote

How to copy only the required records from a sequential file with out writing a COBOL program.
Back to top
View user's profile Send private message

sunish

New User


Joined: 23 May 2005
Posts: 19

PostPosted: Wed Dec 21, 2005 1:32 pm    Post subject: Re: REGARDING Copying the records
Reply with quote

hi

use the jcl sort

consider that your file has 10 records and you want records from 5 to 10 to be written in to another file. give the code. if iam worng pl correct

sort fields=(1,5,ch,a) skiprec=4 stopaft=10
Back to top
View user's profile Send private message
vrakeshmbt

New User


Joined: 17 Aug 2005
Posts: 30

PostPosted: Wed Dec 21, 2005 2:00 pm    Post subject:
Reply with quote

Thanks a lot Sunish
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Dec 21, 2005 10:16 pm    Post subject:
Reply with quote

Quote:
sort fields=(1,5,ch,a) skiprec=4 stopaft=10


This is a sort - it will sort the records by the first 5 bytes, so they will be rearranged (unless they're already in sorted order). A sort is different from a copy.

The question was:

Quote:
How to copy only the required records from a sequential file with out writing a COBOL program.


For a copy operation, use:

Code:

    OPTION COPY

or

    SORT FIELDS=COPY


How you would copy only the required records depends on how you identify the records to be copied. If you want to copy from record x to record x+n (e.g. records 5-10), you can use SKIPREC and STOPAFT (or OUTFIL STARTREC and ENDREC). If you want to copy records identified by a specific criteria (e.g. all the records with 'A' in position 25), you can use INCLUDE. If you want to copy a sample of records (e.g. every 10th record), you can use SAMPLE, etc.

If you need more specific help, describe how you want to identify the records to be copied.
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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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