IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Help, trying to use OVERLAY to get a two digit month


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Reginald Reed

New User


Joined: 02 Jun 2022
Posts: 1
Location: USA

PostPosted: Thu Jun 02, 2022 6:29 am
Reply with quote

Hi,
I know that I can use:
Code:
SORT FIELDS=COPY
OUTREC OVERLAY=(19:DATE1,19:19,8,Y4W)


Which Results in:
Code:
20220601


But how can I just get back the prior month only which would
just be 05 ?

Thanks for your help.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Thu Jun 02, 2022 7:24 am
Reply with quote

Welcome !

You can search this forum or Google it for similar post , I am sure you will get and try some results.
Btw , what if you are in January month , ideally it should change year too to previous year , is that right ?
Back to top
View user's profile Send private message
mistah kurtz

Active User


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

PostPosted: Thu Jun 02, 2022 10:01 am
Reply with quote

Not tested. But see if this works:

Code:
SORT FIELDS=COPY
OUTREC OVERLAY=(19:DATE1,19:19,8,Y4W,SUBMONS,+1,TOGREG=Y4W)
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1337
Location: Bamberg, Germany

PostPosted: Thu Jun 02, 2022 11:42 am
Reply with quote

Code:
OPTION COPY                                               
OUTREC OVERLAY=(19:DATE1,19:19,8,Y4T,SUBMONS,+1,TOGREG=Y4T)

would be correct
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
No new posts To get previous month from current ti... SYNCSORT 7
No new posts BNDS and Overlay command TSO/ISPF 9
Search our Forums:

Back to Top