Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Inserting current date in header record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Inserting current date in header record
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 Moderator


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

PostPosted: Mon Nov 06, 2006 10:14 pm    Post subject:
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    Post subject: Re: Inserting current date in header record
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 Moderator


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

PostPosted: Tue Nov 07, 2006 10:48 pm    Post subject:
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    Post subject: Re: Inserting current date in header record
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 Moderator


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

PostPosted: Wed Nov 08, 2006 12:29 am    Post subject:
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    Post subject: Re: Inserting current date in header record
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    Post subject: Re: Inserting current date in header record
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 Moderator


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

PostPosted: Wed Nov 08, 2006 9:38 pm    Post subject:
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:

http://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    Post subject: Re: Inserting current date in header record
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us