View previous topic :: View next topic
|
Author |
Message |
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
A disk dataset, correct? This will not be on tape? |
|
Back to top |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
yes. The dataset are the generation of GDG |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome - good luck
d |
|
Back to top |
|
|
|