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
 
Fetch Previous month & year in MMYYYY format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Fetch Previous month & year in MMYYYY format
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 User


Joined: 29 Apr 2008
Posts: 388
Location: Maryland

PostPosted: Thu Sep 21, 2017 11:52 pm    Post subject:
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    Post subject: Reply to: Fetch Previous month & year in MMYYYY format
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    Post subject: Reply to: Fetch Previous month & year in MMYYYY format
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    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 Fetch first first row in inner join! Vignesh Sid DB2 9 Tue Dec 04, 2018 7:25 pm
No new posts Previous record x current record jackare SYNCSORT 1 Thu Nov 29, 2018 7:56 am
No new posts Code numeric format to display both '... Time2Live COBOL Programming 7 Wed Nov 21, 2018 10:20 pm
No new posts Vision plus req. In Pune 5 to 10 year capricorn Mainframe Jobs 0 Wed Oct 24, 2018 5:26 pm
No new posts DB2 SQL Query to fetch all instances ... MallikarjunSM DB2 2 Thu Sep 27, 2018 6:46 pm

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