IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File creation date into the program date field


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Fri Jun 27, 2008 11:56 pm
Reply with quote

I need some help. I have a file generated by some other job and I'm using the same file in my program as input. Can anyone tell me how can I get the creation date of that file into my program's date field.

Syntax would be more helpful.

Thanks,
Santosh.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sat Jun 28, 2008 12:03 am
Reply with quote

A disk dataset, correct? This will not be on tape?
Back to top
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Sat Jun 28, 2008 12:13 am
Reply with quote

yes. The dataset are the generation of GDG
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sat Jun 28, 2008 1:09 am
Reply with quote

I've retracted my previous post about using ISPF Library Management (LM) services. There's none available for this case.

Unless someone else comes up with something, this is the only option I can think of:

Invoke a TSO environment using the IKJTSOEV module, then run a REXX exec using the IKJEFTSR module (there are examples posted in this forum). Code the REXX exec to use the LISTDSI function for the allocated DDNAME. Return the value of SYSCREATE (YYYY/DDD) back to the COBOL program for post-processing.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sat Jun 28, 2008 2:34 am
Reply with quote

Hello,

This would be somewhat less than elegant, but you could run an IDCAMS/LISTCAT for the dataset sendng the "printout" to a temporary dataset. You could then read this temporary dataset and get the create date.

If you really need the date, it may be possible to modify the process that creates the file to put the date in a "header" record and your code could simply get the date from the header.
Back to top
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Sat Jun 28, 2008 11:24 pm
Reply with quote

Hi

Can you tell me with the help of a code for IDCAMS/LISTCAT. Suppose the input file is DPSDSNG.TEST.FILE

please explain me with the code as how to get a new file (or temp file) with the current date at the top(header). Because writing a cobol program to just put an current date a header is what i want to avoid.

Thanks,
Santosh
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sat Jun 28, 2008 11:42 pm
Reply with quote

Hello,

Code:
//LISTCAT1 EXEC PGM=IDCAMS     
//SYSPRINT DD SYSOUT=*         
//SYSIN    DD *                 
LISTC ENT('MY.PDS.JCLLIB') ALL

gives
Code:
NONVSAM ------- MY.PDS.JCLLIB                                         
      IN-CAT --- ICAT.VD38200                                           
      HISTORY                                                           
        DATASET-OWNER-----(NULL)     CREATION--------2006.325           
        RELEASE----------------2     EXPIRATION------0000.000           
        ACCOUNT-INFO-----------------------------------(NULL)           
      SMSDATA                                                           
        STORAGECLASS ------SCSTD     MANAGEMENTCLASS----MCPDS           
        DATACLASS --------(NULL)     LBACKUP ---XXXX.XXX.XXXX           
plus more. . .

You would be interested in the "CREATION--------2006.325" value.

Use DPSDSNG.TEST.FILE instead of MY.PDS.JCLLIB.
Back to top
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Sun Jun 29, 2008 12:10 am
Reply with quote

No. the creation date should be in the output file along with the data.

e.g.

creation date
rec1
rec2
rec3
.
.
.
.etc

I think DFSORT/ICETOOL will do that for me. Can you provide me the code for only copy the file with date as header.

Thanks,
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sun Jun 29, 2008 12:51 am
Reply with quote

Hello,

Quote:
Because writing a cobol program to just put an current date a header is what i want to avoid.
It would be wise to simply change the code that creates the file to include the date as a header. . .
Back to top
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Sun Jun 29, 2008 1:03 am
Reply with quote

i wish i could change the original program where this file is created. Because this file is again used by another pgm in the same JOB. I will try with sort to get the current date...or write simple cobol pgm to this.

Thanks,
Santosh
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sun Jun 29, 2008 3:24 am
Reply with quote

Hello,

Quote:
I will try with sort to get the current date
Maybe i misunderstood. . . Is the goal to get the creation date of the file or the current date?

It was my understanding that you needed the file creation date, not today's date. . .
Back to top
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Mon Jun 30, 2008 2:38 pm
Reply with quote

what you understood is correct. I need file creation date. When ever the file gets created i'll write a sortcard to put creation date(which is current date,when job gets executed) and copy it to another file and use it in my program without distubing the production file.

Actually i got the result using ICETOOL.

Thanks for your help.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Jun 30, 2008 8:45 pm
Reply with quote

You're welcome - good luck icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Help required to reset decimal points... DFSORT/ICETOOL 9
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts Sorting Date Field DFSORT/ICETOOL 4
No new posts CONVERT a given date from UTC TO BST CICS 0
Search our Forums:

Back to Top