View previous topic :: View next topic
|
Author |
Message |
nalini_s_in
New User
Joined: 05 Jun 2007 Posts: 5 Location: coimbatore
|
|
|
|
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 |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Or use MYCOPY/F33 to create a new file with temporary criteria selection & give 10 records to copy there. |
|
Back to top |
|
|
nalini_s_in
New User
Joined: 05 Jun 2007 Posts: 5 Location: coimbatore
|
|
|
|
Thank you very much
Regards
Nalini |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you can also use the 3.3 screen and indicate to copy relative records 1 to 10 |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
Also - IDCAMS REPRO with count option |
|
Back to top |
|
|
ruodeer
New User
Joined: 06 Jul 2007 Posts: 58 Location: home
|
|
|
|
The PIPE command is an option as well if you can use it :
such as PIPE < 'FILE1' |TAKE 10| > 'FILE2' |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
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 |
|
|
|