Page 1 of 1

Get file creation date using a COBOL program.

Posted: Mon Sep 14, 2015 3:23 pm
by Anil
Hello,

Is there a way to find out the creation date of a file used in a COBOL program? My team member said that, there isn't a way to do it directly from COBOL.

Any ideas please?

Thanks.

Re: Get file creation date using a COBOL program.

Posted: Mon Sep 14, 2015 3:26 pm
by nicc
Not directly but you could perhaps call a Rexx program from your COBOL program.

Re: Get file creation date using a COBOL program.

Posted: Mon Sep 14, 2015 3:59 pm
by William Collins
Why would you want to know? It is a fairly arbitrary thing.

Re: Get file creation date using a COBOL program.

Posted: Tue Sep 15, 2015 2:04 pm
by Anil
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.

Re: Get file creation date using a COBOL program.

Posted: Tue Sep 15, 2015 2:34 pm
by William Collins
As long as it is for information only, not for any business use, yes?

Re: Get file creation date using a COBOL program.

Posted: Tue Sep 15, 2015 4:03 pm
by nicc
Well, call a rexx program or call IDCAMS directly and parse its output.

Re: Get file creation date using a COBOL program.

Posted: Mon Sep 21, 2015 3:21 pm
by Anil
William Collins wrote:As long as it is for information only, not for any business use, yes?
That's correct. But if it's a no, will the answer change for the approach?

Re: Get file creation date using a COBOL program.

Posted: Mon Sep 21, 2015 3:34 pm
by William Collins
It would be plain stupid to use it for business purposes (JOBs will sometimes be re-run, and then you'd get a completely unexpected date, any formal testing would be nuts).

To get the date, for information only, IDCAMS is a viable choice.

Re: Get file creation date using a COBOL program.

Posted: Sat Oct 03, 2015 1:48 pm
by Anil
William Collins wrote:It would be plain stupid to use it for business purposes (JOBs will sometimes be re-run, and then you'd get a completely unexpected date, any formal testing would be nuts).

To get the date, for information only, IDCAMS is a viable choice.
Thanks IDCAMS has worked for me.