View previous topic :: View next topic
|
Author |
Message |
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
Hi,
Is it possible to use IDCAMS to read only the last 10 records of a VSAM file. If so, how ? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
As far as I know, it is posible, but only if you can identify which record is the 10th from the end..... |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
can u tel me how to do that, in case i know which is the 10th from the last?? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
REPRO has FROMKEY, FROMADDRESS, FROMNUMBER, SKIP and TOKEY, TOADDRESS, TONUMBER, COUNT. These allow you to start and stop pretty much anywhere you want. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Raak,
If you have access to FileAid you can use this:
.
Code: |
***********************************************************************
To get highest 10 recs in a VSAM file
***********************************************************************
//COPYKEY EXEC PGM=FILEAID
//DD01 DD DSN=YOUR.VSAM.FILE
//DD01O DD DSN=file.contains.high.key
//SYSIN DD *
$$DD01 COPYBACK OUT=10
/*
//*
//NEXT EXEC PGM=....
//HIGHKEY DD DSN=file.contains.high.key
//etc....
***********************************************************************
To get 3rd highest key in a VSAM file
***********************************************************************
//COPYREC EXEC PGM=FILEAID
//DD01 DD DSN=input.dsn,DISP=SHR
//DD01O DD DSN=output.dsn,DISP=SHR
//SYSIN DD *
$$DD01 COPYBACK SELECT=3,OUT=1
//SYSPRINT DD SYSOUT=A |
|
|
Back to top |
|
|
|