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 Cobol program till a given time or fo... ankita agarwal COBOL Programming 7 Fri May 18, 2018 2:24 pm
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Replace last name by first name anatol DFSORT/ICETOOL 10 Thu Mar 15, 2018 3:43 pm
No new posts help to replace columns by rows Vikas Maharnawar DFSORT/ICETOOL 8 Tue Mar 06, 2018 3:27 pm
No new posts How to replace the below query? pkmurali DB2 12 Tue Feb 27, 2018 9:51 pm

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