Page 1 of 1

how to read contents of ksds

PostPosted: Tue Jul 20, 2010 11:34 am
by nagendra
how to view contents of a ksds file.

Re: how to read contents of ksds

PostPosted: Tue Jul 20, 2010 11:57 am
by smita257
If you want to read the KSDS, do you want to read it sequentially or randomly?
If sequential then perform a startbrowse in your program checking the key value and then read.
If random directly move the value into key and read the file.

Re: how to read contents of ksds

PostPosted: Tue Jul 20, 2010 12:37 pm
by smita257
You can also view by print the contents through IDCAMS.
//PRINT EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//INPUT DD DSN=YOUR.KSDS,DISP=OLD
//SYSIN DD *
 PRINT
 INFILE(INPUT)
/*

Re: how to read contents of ksds

PostPosted: Tue Jul 20, 2010 2:29 pm
by nagendra
smita257 wrote:U can also view by print the contents through IDCAMS.
//PRINT EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INPUT DD DSN=YOUR.KSDS,DISP=OLD
//SYSIN DD *
PRINT
INFILE(INPUT)
/*



thanx a lot...

Re: how to read contents of ksds

PostPosted: Tue Jul 20, 2010 7:29 pm
by NicC
//INPUT DD DSN=YOUR.KSDS,DISP=OLD


I would change the DISP to SHR unless you have a real need to have exclusve use of the dataset

Re: how to read contents of ksds

PostPosted: Wed Jul 21, 2010 10:32 am
by smita257
Yes.That's correct.

Re: how to read contents of ksds

PostPosted: Wed Jul 21, 2010 1:50 pm
by nagendra
smita257 wrote:You can also view by print the contents through IDCAMS.
//PRINT EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//INPUT DD DSN=YOUR.KSDS,DISP=OLD
//SYSIN DD *
 PRINT
 INFILE(INPUT)
/*



yaa, i just testd it, i got the concept... thanx a lot..