Page 1 of 1

How to find dataset creation date through JCL ??

PostPosted: Fri Nov 12, 2010 6:00 pm
by gauthamnagpur18
Hi ,

I have a PS dataset . I need to find the creation date of that dataset through JCL . I am a fresher . I dunno how to do ??


Thanks
Gautham

Re: How to find dataset creation date through JCL ??

PostPosted: Fri Nov 12, 2010 6:23 pm
by mickeywhite
Quick off my head.
run idcams list on the high level of the dataset name, example DSN=FIRST.SECOND.THIRD.FOURTH ,
then just use FIRST.SECOND.THIRD and don''t put the last level of the dataset name on the idcam statment card. THEN look in the SYSPRINT dd output file and parse for the work CREATION.
The output will have every dataset name with those high level prefixes, so you will have to first search for the specific dataset in the ouput, then the word CREATION
code below:
000004 //STEP00B  EXEC PGM=IDCAMS
000005 //SYSUT2   DD SYSOUT=*
000006 //SYSPRINT DD DSN=FIRST.IDCAMLST.OUTPUT,
000007 //            DISP=(,CATLG,DELETE),
000008 //            UNIT=DISK,
000009 //            SPACE=(CYL,(25,25),RLSE)
000010 //SYSIN    DD *
000011  LISTCAT -
000012         LVL(FIRST.SECOND.THIRD) ALL
000013 /*
000014 //

Re: How to find dataset creation date through JCL ??

PostPosted: Fri Nov 12, 2010 7:33 pm
by gauthamnagpur18
Thanks mickeywhite. I got it . But i need only creation date . But it is showing many parameters like expiration date etc . Whether it is possible to get only creation date .



Thanks
Gautham

Re: How to find dataset creation date through JCL ??

PostPosted: Fri Nov 12, 2010 8:15 pm
by Bill Dennis
That date is when the CATALOG ENTRY was created. It may not be the true creation date of the file if it was uncataloged/recataloged.

A listing of the VTOC (pgm=IEHLIST) will show the actual date for disk files. For tape files list the tape management catalog.

Re: How to find dataset creation date through JCL ??

PostPosted: Fri Nov 12, 2010 9:39 pm
by steve-myers
//A       EXEC PGM=IKJEFT01
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  *
 LISTDS xxx HISTORY
I don't regard the format of the creation date (yyyy.ddd) as very useful, but IDCAMS is juat as useless, IEHLIST is much harder to use than Mr. Dennis implies.

Re: How to find dataset creation date through JCL ??

PostPosted: Fri Nov 12, 2010 10:36 pm
by gauthamnagpur18
Hi ,

I have used above steve-myers code.

but it is throwing error .

I gave

//STEP02 EXEC PGM=IKJEFT01         
//SYSTSPRT DD  SYSOUT=*           
//SYSTSIN  DD  *                   
 LISTDS(TEST.GAUTHAM.OUT) HISTORY 
                                   
/*                                 


but it is showing some error like this in SYSTSPRT

READY                             
 LISTDS(TEST.GAUTHAM.OUT) HISTORY 
INVALID COMMAND NAME SYNTAX       
READY                             
READY                             
END                               



Help me out .

Re: How to find dataset creation date through JCL ??

PostPosted: Sat Nov 13, 2010 12:09 am
by NicC
Try doing it as Steve showed - he does not indicate the use of () around the DSN. However, if you are specifying the full name then you will have to use quotes around the DSN.

Re: How to find dataset creation date through JCL ??

PostPosted: Sat Nov 13, 2010 12:21 am
by steve-myers
The problem is the lack of a blank between the LISTDS and the (. As NicC says, you will probably have to place TEST.GAUTHAM.OUT in quotes. You can use the parenthesis to indicate you want to specify multiple data sets: LISTDS ('TEST.GAUTHAM.OUT' 'some.other.dataset') HISTORY, but they are not required for a single data set name.

Re: How to find dataset creation date through JCL ??

PostPosted: Thu Nov 25, 2010 10:51 pm
by gauthamnagpur18
I got it .Thanks steve-myers.