Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

File creation date into the program date field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: File creation date into the program date field
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

Moderator Team Head


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

PostPosted: Sat Jun 28, 2008 12:03 am    Post subject: Reply to: file creation date.
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    Post subject:
Reply with quote

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

Moderator Team Head


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

PostPosted: Sat Jun 28, 2008 1:09 am    Post subject: Reply to: File creation date into the program date field
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

Site Director


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

PostPosted: Sat Jun 28, 2008 2:34 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sat Jun 28, 2008 11:42 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sun Jun 29, 2008 12:51 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sun Jun 29, 2008 3:24 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Jun 30, 2008 8:45 pm    Post subject: Reply to: File creation date into the program date field
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us