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

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

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 Converting a file from PD to display ... SYNCSORT 4
No new posts Execute step regardless of previous s... JCL & VSAM 2
No new posts Last day of the month via SYNCSORT. SYNCSORT 5
No new posts Date format conversion DFSORT/ICETOOL 4
No new posts Required Date Format in Include Sort ... DFSORT/ICETOOL 6
Search our Forums:

Back to Top