Write record in PS through JCL

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...
durgac
Posts: 2
Joined: Thu Nov 08, 2007 8:33 pm
Skillset: COBOL, CICS, DB2, JCL, VSAM
Referer: Friends

Write record in PS through JCL

Postby durgac » Thu Nov 08, 2007 8:36 pm

I wanted to write the current timestamp into a dataset through JCL. Can this be done? Could any one help me out?

CICS Guy
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am

Re: Write record in PS through JCL

Postby CICS Guy » Thu Nov 08, 2007 8:51 pm

Where are you getting this 'timestamp'?
Can sort header/trailer processing against a dummy input give you what you want?

User avatar
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

Postby Frank Yaeger » Thu Nov 08, 2007 9:54 pm

Here's a DFSORT job that will write the current date in the form 'yyyymmdd' in an output record.

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

durgac
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

Postby durgac » Thu Nov 08, 2007 10:14 pm

Thank you very much!

munni_03
Posts: 3
Joined: Tue Aug 19, 2008 5:55 pm
Skillset: cobol,jcl,db2,cics
Referer: google

Re: Write record in PS through JCL

Postby munni_03 » Tue Aug 19, 2008 6:57 pm

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.

User avatar
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

Postby Frank Yaeger » Tue Aug 19, 2008 8:39 pm

For 'mmddyyyy', you can use this DFSORT INREC statement:

Code: Select all

  INREC BUILD=(DATENS=(MD4))
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

munni_03
Posts: 3
Joined: Tue Aug 19, 2008 5:55 pm
Skillset: cobol,jcl,db2,cics
Referer: google

Re: Write record in PS through JCL

Postby munni_03 » Wed Aug 20, 2008 3:28 pm

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)
/*

User avatar
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

Postby Frank Yaeger » Wed Aug 20, 2008 8:26 pm

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:

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