MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
vinuknr Beginner Joined: 17 Mar 2005 Posts: 3 Topics: 1 Location: London
Posted: Thu Mar 17, 2005 5:10 am Post subject: How to read a last record of a KSDS VSAM file
Hi all,
Any idea how to do this?
I don _________________ Regards,
Vinu
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Mar 17, 2005 8:42 am Post subject:
vinuknr ,
There are couple of ways to do it.
1. You can use an utility like file-aid , sort to write the last record from the vsam cluster.
ex:
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR VSAM FILE,
// DISP=SHR
//SORTOUT DD DSN=LAST.RECORD.FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL NODETAIL,REMOVECC,
TRAILER1=(1,80)
/*
Code:
//STEP0100 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//DD01 DD DSN=INPUT.DATASET,
// DISP=SHR
//DD01O DD DSN=LAST.RECORD.FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=???,BLKSIZE=0)
//SYSIN DD *
$$DD01 COPYBACK OUT=1
/*
Programatically you can use READ PREVIOUS with high-values in the key field of the vsam cluster.
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
vinuknr Beginner Joined: 17 Mar 2005 Posts: 3 Topics: 1 Location: London
Posted: Mon Mar 21, 2005 9:08 am Post subject:
Hi Kolusu,
Thanks a llot for the Solution.
When I tried moving Moving HIGH VALUES to the RIDFLD worked _________________ Regards,
Vinu
Back to top
s_shivaraj Beginner Joined: 21 Sep 2004 Posts: 140 Topics: 14 Location: Chennai, India
Posted: Mon Mar 21, 2005 11:00 pm Post subject:
Hi Vinu,
999 is not a high value for S9(3) COMP-3 variable. High value refers to x'FFFFFF'( Hex value).
Trying moving the above it will work..
Hope the above info helps you. _________________ Cheers
Sivaraj S
'Technical Skill is the Master of complexity, while Creativity is the Master of Simplicity'
Back to top
vinuknr Beginner Joined: 17 Mar 2005 Posts: 3 Topics: 1 Location: London
Posted: Tue Mar 22, 2005 4:29 am Post subject: Hi
Thanks Shivaraj. _________________ Regards,
Vinu
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum