Get file creation date using a COBOL program.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Anil
Registered Member
Posts: 70
Joined: Sun Jun 16, 2013 12:41 am

Get file creation date using a COBOL program.

Post 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.
Thanks,
Anil
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Get file creation date using a COBOL program.

Post by nicc »

Not directly but you could perhaps call a Rexx program from your COBOL program.
Regards
Nic
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Get file creation date using a COBOL program.

Post by William Collins »

Why would you want to know? It is a fairly arbitrary thing.
Anil
Registered Member
Posts: 70
Joined: Sun Jun 16, 2013 12:41 am

Re: Get file creation date using a COBOL program.

Post 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.
Thanks,
Anil
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Get file creation date using a COBOL program.

Post by William Collins »

As long as it is for information only, not for any business use, yes?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Get file creation date using a COBOL program.

Post by nicc »

Well, call a rexx program or call IDCAMS directly and parse its output.
Regards
Nic
Anil
Registered Member
Posts: 70
Joined: Sun Jun 16, 2013 12:41 am

Re: Get file creation date using a COBOL program.

Post 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?
Thanks,
Anil
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Get file creation date using a COBOL program.

Post 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.
Anil
Registered Member
Posts: 70
Joined: Sun Jun 16, 2013 12:41 am

Re: Get file creation date using a COBOL program.

Post 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.
Thanks,
Anil
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”