Write record in PS through JCL
-
- Posts: 2
- Joined: Thu Nov 08, 2007 8:33 pm
- Skillset: COBOL, CICS, DB2, JCL, VSAM
- Referer: Friends
Write record in PS through JCL
I wanted to write the current timestamp into a dataset through JCL. Can this be done? Could any one help me out?
Re: Write record in PS through JCL
Where are you getting this 'timestamp'?
Can sort header/trailer processing against a dummy input give you what you want?
Can sort header/trailer processing against a dummy input give you what you want?
- Frank Yaeger
- Global moderator
- Posts: 1079
- Joined: Sat Jun 09, 2007 8:44 pm
- Skillset: DFSORT, ICETOOL, ICEGENER
- Referer: Search
- Contact:
Re: Write record in PS through JCL
Here's a DFSORT job that will write the current date in the form 'yyyymmdd' in an output record.
If you want something else, be more specific about what you want (form of date, RECFM and LRECL of output data set, etc).
Code: Select all
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DSN=... output file (FB/8)
//SYSIN DD *
OPTION COPY
INREC BUILD=(DATE1)
/*
If you want something else, be more specific about what you want (form of date, RECFM and LRECL of output data set, etc).
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Posts: 2
- Joined: Thu Nov 08, 2007 8:33 pm
- Skillset: COBOL, CICS, DB2, JCL, VSAM
- Referer: Friends
Re: Write record in PS through JCL
Thank you very much!
Re: Write record in PS through JCL
Code: Select all
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DSN=... output file (FB/8)
//SYSIN DD *
OPTION COPY
INREC BUILD=(DATE1)
/*
its giving output date format as yyyymmdd but i want in mmddyyyy.
- Frank Yaeger
- Global moderator
- Posts: 1079
- Joined: Sat Jun 09, 2007 8:44 pm
- Skillset: DFSORT, ICETOOL, ICEGENER
- Referer: Search
- Contact:
Re: Write record in PS through JCL
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Re: Write record in PS through JCL
Hi
I got the exact output but i am comparing date fields.
in this i want date of 60 days before by subtracting 60 days frm it...
but its giving error..can u help on tis
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DSN=... output file (FB/8)
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(DATE-60)
/*
I got the exact output but i am comparing date fields.
in this i want date of 60 days before by subtracting 60 days frm it...
but its giving error..can u help on tis
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DSN=... output file (FB/8)
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(DATE-60)
/*
- Frank Yaeger
- Global moderator
- Posts: 1079
- Joined: Sat Jun 09, 2007 8:44 pm
- Skillset: DFSORT, ICETOOL, ICEGENER
- Referer: Search
- Contact:
Re: Write record in PS through JCL
Sigh. Why didn't you say what you actually wanted in your first post or subsequent posts? It's not clear how what you've said you want so far has to do with your statement "i am comparing date fields".
However, if you want the current date - 60 days in the form 'mmddyyyy', you can use these DFSORT statements:
If that isn't what you want, then explain in detail exactly what it is you want to do.
However, if you want the current date - 60 days in the form 'mmddyyyy', you can use these DFSORT statements:
Code: Select all
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DSN=... output file (FB/8)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,BUILD=(DATE1-60)),
IFTHEN=(WHEN=INIT,BUILD=(5,4,1,4))
/*
If that isn't what you want, then explain in detail exactly what it is you want to do.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort