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
 

 

Find and replace YccyyMmm to previous month.

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

New User


Joined: 14 Aug 2011
Posts: 24
Location: india

PostPosted: Fri Oct 09, 2015 1:19 am    Post subject: Find and replace YccyyMmm to previous month.
Reply with quote

Hello,

I need to read input file and replace YyyyyMmm to previous month details i.e. Y2015M09.

Code:

//SORTIN   DD *                       
<SERVER>                                                     
<LOGIN ID & PWD>
PUT  ‘ABCD.A1234.FILE1.YyyyyMmm'      FILE1.TXT                             
PUT  ‘ABCD.A1234.FILE2.YyyyyMmm'      FILE2.TXT
QUIT                                                                           
/*                                     


Output should be
Code:

<SERVER>                                                     
<LOGIN ID & PWD>
PUT  ‘ABCD.A1234.FILE1.Y2015M09'      FILE1.TXT                             
PUT  ‘ABCD.A1234.FILE2.Y2015M09'      FILE2.TXT       
QUIT 
/*   


thank you for your help in advance.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Oct 09, 2015 1:54 am    Post subject: Reply to: Find and replace YccyyMmm to previous month.
Reply with quote

OK, but where are you going to get your date from to work out what the previous month is?
Back to top
View user's profile Send private message
santosh_g

New User


Joined: 14 Aug 2011
Posts: 24
Location: india

PostPosted: Fri Oct 09, 2015 2:02 am    Post subject:
Reply with quote

From current date (like DATE2 -1) and pull only yyyy and mm.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Oct 09, 2015 2:34 am    Post subject: Reply to: Find and replace YccyyMmm to previous month.
Reply with quote

And what are you going to do for testing? And what are you going to do for a re-run which is inconveniently "outside" the month which would give the "correct" result?

Bad idea.

If you're doing that, what problem do you have in achieving it? Why would you use FINDREP? The date is in a fixed position and is identifiable.
Back to top
View user's profile Send private message
santosh_g

New User


Joined: 14 Aug 2011
Posts: 24
Location: india

PostPosted: Fri Oct 09, 2015 7:25 pm    Post subject:
Reply with quote

I tried something below for test runs but it didn't work out.

I was not using FINDREP but IFTHEN & OVERLAY.

Code:

//SORTIN   DD * 
&YYYYMMDD       
/*               



Code:

SORT FIELDS=COPY                                           
INREC IFOUTLEN=80,IFTHEN=(WHEN=INIT,                       
OVERLAY=(81:DATE2-1,C'01',81:81,8,Y4T,LASTDAYM,TOGREG=Y4T, 
           11:87,2,85,2,81,4))                             
IFTHEN=(WHEN=(1,9,CH,EQ,C'&YYYYMMDD'),                     
OVERLAY=(81:DATE2-1,C'01',81:81,8,Y4T,LASTDAYM,TOGREG=Y4T, 
           11:C'Y',12:81,4,16:C'M',17,87,2))               
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Oct 09, 2015 8:34 pm    Post subject: Reply to: Find and replace YccyyMmm to previous month.
Reply with quote

In what way didn't it work? Can you show the sysout and any results, please?
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 How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to get previous month in SYMNAMES Suganya87 SYNCSORT 9 Fri Oct 28, 2016 1:37 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm


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