View previous topic :: View next topic |
Author |
Message |
pramitdas Beginner
Joined: 26 Aug 2016 Posts: 12 Topics: 3
|
Posted: Sat Aug 27, 2016 11:41 pm Post subject: Add system date inside of a PS file at particular column Rea |
|
|
I have the below requirement.
I have a PS file: ABC.BCD.XYZ with the 2 header records.
ABC.BCD.XYZ Code: |
_________________________________________
Details of Employee
Empno EMPid EMPName DEPTName
__________________________________________
|
I need to copy this header to another file: XYZ.XYZ.XYZ but I need to add current date ( Date format should be YYMMDD- for e.g. 160828 ) in the first header record at some particular position, Say column no : 60
So my output should look like :
XYZ.XYZ.XYZ Code: |
_____________________________________
Details of Employee 160828
Empno EMPid EMPName DEPTName
_____________________________________
|
Can you please help with this? A sort step or anything?
Please note that I need a simple step to achieve. COBOL/SAS/EZ will not be an option as agreed with Client. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
|
Posted: Sun Aug 28, 2016 12:05 am Post subject: |
|
|
pramitdas,
Try this untested jcl
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
HDATE,S'&LYR2.&LMON.&LDAY'
//SORTIN DD DISP=SHR,DSN=Your input FB 80 byte file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(81,8,ZD,EQ,1),OVERLAY=(60:HDATE))
//* |
_________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu
Last edited by kolusu on Mon Aug 29, 2016 9:59 am; edited 1 time in total |
|
Back to top |
|
|
pramitdas Beginner
Joined: 26 Aug 2016 Posts: 12 Topics: 3
|
Posted: Sun Aug 28, 2016 12:35 am Post subject: |
|
|
kolusu wrote: | pramitdas,
Try this untested jcL |
Thank you.. I will test and let you know. |
|
Back to top |
|
|
pramitdas Beginner
Joined: 26 Aug 2016 Posts: 12 Topics: 3
|
Posted: Mon Aug 29, 2016 2:02 am Post subject: |
|
|
pramitdas wrote: | kolusu wrote: | pramitdas,
Try this untested jcL |
Thank you.. I will test and let you know. |
Thanks a lot Kolusu.
It has worked perfectly and kudos for your help.
Only there is a typo error ( one quote ' is missing) in the below line.
Code: | HDATE,S'&LYR2.&LMON.&LDAY' | .
Again many thanks!! |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
|
|