Write record in PS through JCL



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

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?
durgac
 
Posts: 2
Joined: Thu Nov 08, 2007 8:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Write record in PS through JCL

 

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?
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

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.

//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
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Write record in PS through JCL

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

Thank you very much!
durgac
 
Posts: 2
Joined: Thu Nov 08, 2007 8:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Write record in PS through JCL

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

//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.
munni_03
 
Posts: 4
Joined: Tue Aug 19, 2008 5:55 pm
Has thanked: 0 time
Been thanked: 0 time

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:

  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
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

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)
/*
munni_03
 
Posts: 4
Joined: Tue Aug 19, 2008 5:55 pm
Has thanked: 0 time
Been thanked: 0 time

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:

//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
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post