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

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


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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: Canada

PostPosted: Thu Aug 09, 2007 10:50 am
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

Superior Member


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

PostPosted: Thu Aug 09, 2007 12:06 pm
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
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: 6966
Location: porcelain throne

PostPosted: Thu Aug 09, 2007 2:53 pm
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
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: 58
Location: home

PostPosted: Tue Oct 30, 2007 1:53 pm
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: 1287
Location: Chennai, India

PostPosted: Tue Oct 30, 2007 2:14 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Oct 30, 2007 2:24 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top