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
 

 

Get the first 10 records in a sequential file which has 1000

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
nalini_s_in

New User


Joined: 05 Jun 2007
Posts: 5
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

muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
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 Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

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: 5
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

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

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

Active Member


Joined: 20 Jan 2007
Posts: 684
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

New User


Joined: 06 Jul 2007
Posts: 59
Location: home

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: 1288
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: 10256
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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