IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REGARDING Copying the records


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
Reply with quote

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

DFSORT Developer


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

PostPosted: Wed Dec 21, 2005 10:16 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 4
No new posts ICETOOL returns no records JCL & VSAM 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top