MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Add system date inside of a PS file at particular column Rea

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
pramitdas
Beginner


Joined: 26 Aug 2016
Posts: 12
Topics: 3

PostPosted: Sat Aug 27, 2016 11:41 pm    Post subject: Add system date inside of a PS file at particular column Rea Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Sun Aug 28, 2016 12:05 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
pramitdas
Beginner


Joined: 26 Aug 2016
Posts: 12
Topics: 3

PostPosted: Sun Aug 28, 2016 12:35 am    Post subject: Reply with quote

kolusu wrote:
pramitdas,

Try this untested jcL


Thank you.. I will test and let you know.
Back to top
View user's profile Send private message
pramitdas
Beginner


Joined: 26 Aug 2016
Posts: 12
Topics: 3

PostPosted: Mon Aug 29, 2016 2:02 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Mon Aug 29, 2016 9:58 am    Post subject: Reply with quote

pramitdas wrote:
Only there is a typo error ( one quote ' is missing) in the below line.

Code:
HDATE,S'&LYR2.&LMON.&LDAY'
.

Again many thanks!!


Thanks, will edit the post to reflect the missing quote

Check this topic for rules against posting across multiple helpboards

http://www.mvsforums.com/helpboards/viewtopic.php?t=8248
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group