Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Get the first 10 records in a sequential file which has 1000

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions
Author Message
nalini_s_in

New User


Joined: 05 Jun 2007
Posts: 3
Location: coimbatore

PostPosted: Thu Aug 09, 2007 10:44 am    Post subject: Get the first 10 records in a sequential file which has 1000
Reply with quote

Hi Everybody

Recently I faced this question in an interview.

How to get the first 10 records in a sequential file which has 1000 of records in it.
Can anybody help me in this.

Nalini
Back to top
View user's profile Send private message
References
PostPosted: Thu Aug 09, 2007 10:44 am    Post subject: Re: Get the first 10 records in a sequential file which has 1000 Reply with quote

muthuvel

Active User


Joined: 29 Nov 2005
Posts: 179
Location: Chennai

PostPosted: Thu Aug 09, 2007 10:50 am    Post subject: Re: Interview Question
Reply with quote

If you want to do it using COBOL ;read only first 10 records from the input file using a read counter and write it to the output file.
If you want to do it using JCL;use STOPAFT=10 in your JCL control card
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 1951
Location: Phoenix, AZ

PostPosted: Thu Aug 09, 2007 12:06 pm    Post subject:
Reply with quote

Or use MYCOPY/F33 to create a new file with temporary criteria selection & give 10 records to copy there.
Back to top
View user's profile Send private message
nalini_s_in

New User


Joined: 05 Jun 2007
Posts: 3
Location: coimbatore

PostPosted: Thu Aug 09, 2007 2:44 pm    Post subject:
Reply with quote

Thank you very much

Regards
Nalini
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1519
Location: germany

PostPosted: Thu Aug 09, 2007 2:53 pm    Post subject:
Reply with quote

you can also use the 3.3 screen and indicate to copy relative records 1 to 10
Back to top
View user's profile Send private message
Devzee

Senior Member


Joined: 20 Jan 2007
Posts: 709
Location: Hollywood

PostPosted: Fri Aug 10, 2007 10:37 am    Post subject:
Reply with quote

Also - IDCAMS REPRO with count option
Back to top
View user's profile Send private message
ruodeer

Active User


Joined: 06 Jul 2007
Posts: 51
Location: USA

PostPosted: Tue Oct 30, 2007 1:53 pm    Post subject:
Reply with quote

The PIPE command is an option as well if you can use it :
such as PIPE < 'FILE1' |TAKE 10| > 'FILE2'
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1063
Location: Chennai - India

PostPosted: Tue Oct 30, 2007 2:14 pm    Post subject: Reply to: Get the first 10 records in a sequential file whic
Reply with quote

ruodeer,

Could you please give more details on the PIPE command? From where shd i issue this command? Isn't it site-specific or a TSO command?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2656
Location: italy

PostPosted: Tue Oct 30, 2007 2:24 pm    Post subject: Reply to: Get the first 10 records in a sequential file whic
Reply with quote

Not a vanilla tso command ....

there is a pipe command available in vm
there could be something also in MVS, once upon a time there
was an offering called batch pipelines

search for "vm pipe command melinda varian"

the lady seems to be an early promoter of vm pipelines,
if I remember correctly she was jokingly called "the Chief Plumber"

anyway the pipeline concept is implicit in unix/unix_like shells
by using the "pipe operator |"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions All times are GMT + 6 Hours
Page 1 of 1