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
 
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: 7314

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: 7314

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: 7314

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 it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm
No new posts Reg:Displaying the particular month o... bhavana yalavarthi All Other Mainframe Topics 4 Sat Jul 08, 2017 8:13 pm
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am

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