Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Copy records from a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
vasuma

New User


Joined: 23 Aug 2007
Posts: 4
Location: pune,india

PostPosted: Thu Sep 06, 2007 7:24 pm    Post subject: Copy records from a file
Reply with quote

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

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Sep 06, 2007 7:43 pm    Post subject:
Reply with quote

SORT FIELDS=COPY,SKIPREC=?,STOPAFT=?
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: Thu Sep 06, 2007 9:32 pm    Post subject:
Reply with quote

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

New User


Joined: 23 Aug 2007
Posts: 4
Location: pune,india

PostPosted: Fri Sep 07, 2007 6:45 pm    Post subject: without a jcl
Reply with quote

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

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Sep 07, 2007 6:54 pm    Post subject: Re: without a jcl
Reply with quote

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

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Sat Sep 08, 2007 10:40 am    Post subject:
Reply with quote

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

New User


Joined: 23 Aug 2007
Posts: 4
Location: pune,india

PostPosted: Sat Sep 08, 2007 12:38 pm    Post subject:
Reply with quote

hi devzee,


i execute it using unix and not jcl.


thanks
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Sep 09, 2007 4:32 am    Post subject:
Reply with quote

Hello Vasuma and welcome to the forums,

Which unix platform are you running on?

Which COBOL are you using?
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us