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: 13

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: 189
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: 13

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: 13

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 it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts FTP data transfer from PC to Mainfram... AJAYREDDY All Other Mainframe Topics 8 Wed Aug 23, 2017 9:59 pm
No new posts Reg:Displaying the particular month o... bhavana yalavarthi All Other Mainframe Topics 4 Sat Jul 08, 2017 8:13 pm

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