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

Fetch Previous month & year in MMYYYY format


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

New User


Joined: 30 Sep 2006
Posts: 14

PostPosted: Thu Sep 21, 2017 9:54 pm
Reply with quote

I wrote a small SORT JCL in which I tried to fetch the date and it worked.

Can someone please help me what operand I need to give in TRAILER1 if I just need previous month & current year e.g. 082017 or 201708 or 08/2017 or 2017/08

SORTIN DD *

SORTOF1 DD mydataset

SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOF1, REMOVECC, TRAILER1=(DATE)
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2081
Location: USA

PostPosted: Thu Sep 21, 2017 11:52 pm
Reply with quote

Code:
...,&DATE2-1,...
Back to top
View user's profile Send private message
girishb2

New User


Joined: 30 Sep 2006
Posts: 14

PostPosted: Fri Sep 22, 2017 12:06 am
Reply with quote

Does it work with TRAILER1 ? I just tried it says Syntax error. :-(
Back to top
View user's profile Send private message
girishb2

New User


Joined: 30 Sep 2006
Posts: 14

PostPosted: Fri Sep 22, 2017 12:21 am
Reply with quote

I got it. Thank you.


//SORTIN DD *
abcd
/*

SORTOF1 DD mydataset

SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOF1, REMOVECC, OVERLAY=(&DATE2(/)-1)

It worked. :-)
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 Format Binary file to EBCDIC JCL & VSAM 4
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 5
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
Search our Forums:

Back to Top