|
|
| Author |
Message |
nalini_s_in
New User
Joined: 05 Jun 2007 Posts: 3 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 |
|
 |
References
|
Posted: Thu Aug 09, 2007 10:44 am Post subject: Re: Get the first 10 records in a sequential file which has 1000 |
 |
|
|
 |
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 179 Location: Chennai
|
|
|
|
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 D.
Senior Member
Joined: 22 Apr 2006 Posts: 1705 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: 3 Location: coimbatore
|
|
|
|
Thank you very much
Regards
Nalini |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1388 Location: germany
|
|
|
|
| you can also use the 3.3 screen and indicate to copy relative records 1 to 10 |
|
| Back to top |
|
 |
Devzee
Senior Member
Joined: 20 Jan 2007 Posts: 714 Location: Hollywood
|
|
|
|
| Also - IDCAMS REPRO with count option |
|
| Back to top |
|
 |
ruodeer
New User
Joined: 06 Jul 2007 Posts: 49 Location: USA
|
|
|
|
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: 1003 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
Global Moderator
Joined: 14 Mar 2007 Posts: 2560 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 |
|
 |
|
|