Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Add system date inside of a PS file at particular column

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
pramitdas

New User


Joined: 27 Aug 2016
Posts: 3
Location: India

PostPosted: Sun Aug 28, 2016 12:06 am    Post subject: Add system date inside of a PS file at particular column
Reply with quote

I have the below requirement.
I have a PS file: ABC.BCD.XYZ with the 2 header records.

ABC.BCD.XYZ
_________________________________________
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
_____________________________________
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

mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 287
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Sun Aug 28, 2016 1:30 pm    Post subject:
Reply with quote

Quote:
Can you please help with this? A sort step or anything?

Did you try anything?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1922
Location: UK

PostPosted: Sun Aug 28, 2016 4:06 pm    Post subject:
Reply with quote

Please use the code tags when presenting JCL, data, program code, control cards or anything else that you would see on your terminal.

Also, you do not have any files - you have data sets.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 408
Location: USA

PostPosted: Mon Aug 29, 2016 8:04 pm    Post subject: Reply to: Add system date inside of a PS file at particular column
Reply with quote

Quote:
Please note that I need a simple step to achieve. COBOL/SAS/EZ will not be an option as agreed with Client.

So, you don't know how simple or difficult it could be. You don't know how to do it and it seems that you don't even want to try. But then, you go ahead and make false promises to your Client. Not good.

.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 210
Location: Chennai

PostPosted: Mon Aug 29, 2016 9:23 pm    Post subject: Reply to: Add system date inside of a PS file at particular column
Reply with quote

incase first header is unique and always will have "DETAILS" in 1,7 position, use the below code.

Code:

//STEP0200 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SYMNOUT  DD SYSOUT=*                                           
//SYMNAMES DD *                                                 
HDATE,S'&LYR2.&LMON.&DAY'                                       
//SORTIN   DD DSN=UR INPUT FB/80                                                                                 
//SORTOUT  DD DSN=UR OUPUT FB/80                                           
//SYSIN    DD *                                                 
  OPTION COPY,STOPAFT=2                                         
  INREC IFTHEN=(WHEN=(1,7,CH,EQ,C'DETAILS'),OVERLAY=(60:HDATE)) 
//*                                                             


Incase header in not unique use below code, assuming LRECL=80
Code:

//STEP0200 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SYMNOUT  DD SYSOUT=*                                     
//SYMNAMES DD *                                           
HDATE,S'&LYR2.&LMON.&DAY'                               
//SORTIN   DD DSN=UR INPUT FB/80                                                                                 
//SORTOUT  DD DSN=UR OUPUT FB/80                                   
//SYSIN    DD *                                           
  OPTION COPY,STOPAFT=2                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),       
        IFTHEN=(WHEN=(81,8,ZD,EQ,1),OVERLAY=(60:HDATE)),   
        IFOUTLEN=80                                       
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1818
Location: NY,USA

PostPosted: Mon Aug 29, 2016 9:36 pm    Post subject:
Reply with quote

Welcome!
You will need to do a research and try something yourself as told by RahulG31 and then someone can help further if you get into any problems.
Try this.
Code:
SORT FIELDS=COPY                                           
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),         
      IFTHEN=(WHEN=(81,8,ZD,EQ,+1),OVERLAY=(60:DATE1))     
OUTFIL INCLUDE=(81,8,ZD,EQ,+1,OR,81,8,ZD,EQ,+2),BUILD=(1,80)
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us