Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copying first 50 records from a KSDS file using IDCAMS

Status
Not open for further replies.

saby

Programmer
Mar 4, 2003
2
IN
Hi
Can anyone please tell me how to copy first 50 records from a KSDS file using the IDCAMS utility

Thanks
Saby
 
Hi Saby,
A piece of JCL similar to below should do the trick:

//IDCAMS EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DDIN1 DD DSN=USERID.KSDS.INPUT,DISP=SHR
//DDOUT1 DD DSN=USERID.KSDS.INPUT,DISP=SHR
//SYSIN DD *
REPRO INFILE (DDIN1) OUTFILE (DDOUT1) COUNT(50)
/*

hth Marc
 
Hi Saby,

You can use SORT. If memory serves, the cntl card is ~

COPY STOPAFT=50

Regards, Jack.
 
Further thoughts on the IDCAMS Saby,
If you know the keys you are after, you could use FROMKEY(key) TOKEY.
If you know the relative byte address, you could use FROMADDRESS(address) TOADDRESS(address).
And if you know the relative record number, you could use FROMNUMBER(num) TONUMBER(num)

Marc
 
P.S. - It doesn't matter much for 50 recs, but SORT is much faster than IDCAMS for sequential processing functions.

Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top