View previous topic :: View next topic
|
Author |
Message |
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
David P
Active User
Joined: 11 Apr 2005 Posts: 106 Location: Cincinnati Ohio
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
David P
Active User
Joined: 11 Apr 2005 Posts: 106 Location: Cincinnati Ohio
|
|
|
|
Thanks for the response Frank. I tried it and it looks good.
-David P. |
|
Back to top |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
Hi Frank,
Thanks a lot.
As I expected they asked me to change it. |
|
Back to top |
|
|
|