Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Compare Months from Input file with Current Month

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Wed Aug 01, 2012 5:30 pm    Post subject: Compare Months from Input file with Current Month
Reply with quote

Hi,

This is my input file with LRECL=80
Code:

RECORD1 2010-05-01
RECORD2 2010-08-01
RECORD3 2011-03-01
RECORD4 2011-08-01
RECORD5 2010-09-01
RECORD6 2010-12-01


I want to compare the Month(MM) in each record with Current-Month and write only those records whose month is equal to current month.

Current month is August, ie, 08

So my expected output will be
Code:

RECORD2 2010-08-01
RECORD4 2011-08-01


Please gudie me ! Thanks
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Aug 01, 2012 5:37 pm    Post subject: Reply to: Compare Months from Input file with Current Month
Reply with quote

What is your source of "Current-Month"? Hopefully a file with business date/data date?

There are examples here using the generation of SYMNAMEs. Also works if you need "run date", but then you have to consider midnight, and re-runs and things.
Back to top
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Wed Aug 01, 2012 6:13 pm    Post subject:
Reply with quote

@Bill

Current Date would be the run date of the job, I know of DATE1(4MD-) funtion, but have no idea how to apply in this particular requirement.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Aug 01, 2012 6:31 pm    Post subject: Reply to: Compare Months from Input file with Current Month
Reply with quote

Look at the manual for "Using Symbols for Fields and Constants", concentrate on the system symbols (which you specify as s' or S') and you should find how you can specify a constant for your month and then use that to compare against your data in INCLUDE/OMIT.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Aug 01, 2012 10:12 pm    Post subject:
Reply with quote

use the following DFSORT JCL
Code:

//STEP0100 EXEC PGM=SORT         
//SYSOUT   DD SYSOUT=*           
//SYMNAMES DD *                   
MNUM,S'&LMON'                     
//SORTIN   DD *                   
RECORD1 2010-05-01               
RECORD2 2010-08-01               
RECORD3 2011-03-01               
RECORD4 2011-08-01               
RECORD5 2010-09-01               
RECORD6 2010-12-01               
//SORTOUT  DD SYSOUT=*           
//SYSIN    DD *                   
  INCLUDE COND=(14,2,CH,EQ,MNUM) 
  SORT FIELDS=COPY               
//*
Back to top
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Thu Aug 02, 2012 12:29 am    Post subject:
Reply with quote

Thanks a lot SKOLUSU.....
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us