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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Obtain the MVS File Create Date via COBOL 2

Status
Not open for further replies.

rasETL

IS-IT--Management
May 28, 2003
213
0
0
US
Is there any way in COBOL to obtain the Creation date of the File being Read in as input?

I am runing under IBM Z/OS. I would like to obtain the date the file was created from the catalog so I could include it in the data being written to output.

In some cases, the input file will be Disk (DASD), in other cases the input file will be Tape or virtual Tape.

 
I'm pretty sure that you have to invoke an external service, either TSO or ISPF, and then use the functions available to them to retrieve the creation date of a dataset.

The easiest option of the two, in my opinion, is the call to ISPF services, passing the DDNAME as a variable, which instructs ISPF to run a REXX EXEC. This REXX EXEC would use the LISTDSI routine to retrieve the dataset attributes for the DDNAME, load them into ISPF variables, which the COBOL program can then retrieve and process.

Running a TSO service such as LISTCAT may be possible also.
 
I wouldn't bother calling TSO or ISPF to run a REXX etc. as you can call IDCAMS from Cobol. The article here: shows how to code the LISTCAT call in a Cobol program. All you'll need to do is add the ALL parm and then look for the creation date in the output. This date may need a bit of manipulating as it is usually a julian date.

Hope this helps.
Marc
 
Thanks for the suggestions.

As it turns out, I found someone who had a CLIST that did exactly what I wanted. Therefore, rather than reinvent the wheel, I will simply add an EXEC PGM=IKJEFT01 Step to the job to execute the CLIST.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top