IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Inserting current date in header record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Mon Nov 06, 2006 6:58 pm
Reply with quote

Hi all,

I am having a dataset with Header records. This data set contain 3 Header lines.

Now I want to insert current date in 2nd Header Line thru JCL.
This dataset created manually, is not coming from any of the program.

for example my dataset is :
Report
Report of ¤t date
employeeid employee name brand place

The above dataset created manually. Now in this dataset I have to insert current date in the 2nd header line.

Can you please suggest me. ICETOOL is not operational in my shop.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Nov 06, 2006 10:14 pm
Reply with quote

The solution depends on exactly what your header records look like. Please show an example of your input records and what exactly you want for output. In particular, show what form you want the date in (e.g C'yyyymmdd' or C'yyyyddd' or ?). Also, what is the RECFM and LRECL of the input file?
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Tue Nov 07, 2006 9:31 am
Reply with quote

Hi Frank,

My Input contains 3 header lines.
1) REPORT NAME
2) REPORT OF CURRENT DATE
3) HEADINGS OF ALL COLUMNS

In this 2nd headerline I need to add current date after "REPORT OF" in the form of c'yyyymmdd'.

My record length is 150.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Nov 07, 2006 10:48 pm
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD DSN=... output file (FB)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,9,CH,EQ,C'REPORT OF'),
    OVERLAY=(11:DATE1,15X))
/*
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Wed Nov 08, 2006 12:16 am
Reply with quote

Hi frank,

I have one querry regarding the solution that you had given above.

While running the ICEMAN step if there are any other records with REPORT OF at the same position those will also be modified. In other words how can we make sure that the OVERLAY option will be used only for the second record.

-Thanks in advance.
David P.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 08, 2006 12:29 am
Reply with quote

If you want to use the 2nd record rather than 'REPORT OF' to identify the record to be modified, you can use this DFSORT job:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/150)
//SORTOUT DD DSN=...  output file (FB/150)
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=150,
    IFTHEN=(WHEN=INIT,OVERLAY=(151:SEQNUM,8,ZD)),
    IFTHEN=(WHEN=(151,8,ZD,EQ,+2),
      OVERLAY=(11:DATE1,15X))
/*
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Wed Nov 08, 2006 2:57 am
Reply with quote

Thanks for the response Frank. I tried it and it looks good.

-David P.
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Wed Nov 08, 2006 10:39 am
Reply with quote

Hi Frank,

Thanks for the reply. Its working fine.

One more thing I want to ask, when we mention DATE1, format will be YYYYMMDD.

But most of our reports we will display date in MM/DD/YY format.
Is it possible to display the date in the above format?
Ofcourse presently I am using DATE1 only.

But I dont know if they ask for MM/DD/YY format then I need to change.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 08, 2006 9:38 pm
Reply with quote

DFSORT allows you to specify a wide variety of dates. For mm/dd/yy, you can use DATE=(MDY/) - for a list of all of the available date and time formats, see the "How can I put timestamps in my output records?" Ask Professor Sort item at:

www.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Thu Nov 09, 2006 9:33 am
Reply with quote

Hi Frank,

Thanks a lot.
As I expected they asked me to change it.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top