View previous topic :: View next topic
|
Author |
Message |
vasuma
New User
Joined: 23 Aug 2007 Posts: 4 Location: pune,india
|
|
|
|
How can I copy selected records from a sequential file say for instance only first 10 records of 100, using a copy verb. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
SORT FIELDS=COPY,SKIPREC=?,STOPAFT=? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
vasuma,
You can use this DFSORT job to copy the first 10 records:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY,STOPAFT=10
/*
|
You can use other DFSORT statements to copy other selected records. Which DFSORT statements you would use depends on which records you want to copy. |
|
Back to top |
|
|
vasuma
New User
Joined: 23 Aug 2007 Posts: 4 Location: pune,india
|
|
|
|
hi frank,
I need to do it using a cobol code i mean i am supposed to code a cobol programme for that as i do not have JCL in my environment.
Thanks |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
vasuma wrote: |
I need to do it using a cobol code i mean i am supposed to code a cobol programme for that as i do not have JCL in my environment. |
Might have made sense to post the question in the COBOL area......
Another problem, there is no "copy verb", only read and write verbs.....
Open the input and output files
Read a record
Decide if you want to write that record
Decide if you are done
Close both files
Done |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
Quote: |
i do not have JCL in my environment. |
If your environment is IBM MF then how will your COBOL program be executed without JCL. |
|
Back to top |
|
|
vasuma
New User
Joined: 23 Aug 2007 Posts: 4 Location: pune,india
|
|
|
|
hi devzee,
i execute it using unix and not jcl.
thanks |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Vasuma and welcome to the forums,
Which unix platform are you running on?
Which COBOL are you using? |
|
Back to top |
|
|
|