Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to filter out certain records based on current date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
manugeorge2004

New User


Joined: 17 Jun 2009
Posts: 36
Location: Denver

PostPosted: Wed Jun 17, 2020 10:05 pm    Post subject: How to filter out certain records based on current date
Reply with quote

I have a job which submits batch CA7 control cards. But on a specific day (Christmas) ,I want a different card to execute ( I dont want couple of CA7 commands to execute).
Is there a way in JCL where I can test in IF THEN statements to check for MMDD of current date and execute a different step.

If thats not possible, Can I filter out couple of statements from my CA7 control card based on current date. Basically, I have control card like below

Line1
Line2
Line3
Line4

I want to filter out Line3 only on Christmas day. Nothing in the content will tell me about date.

Line1
Line2
Line4
Back to top
View user's profile Send private message

sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 803
Location: Maryland

PostPosted: Wed Jun 17, 2020 11:15 pm    Post subject:
Reply with quote

There is no such way in neither JCL, nor VSAM.

Try to think about SORT, REXX... approach

P.S.
None of Line1.....Line4 can be executed as any command in any environment... 358.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8551
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 17, 2020 11:37 pm    Post subject: Reply to: How to filter out certain records based on current date
Reply with quote

You might be able to do this with CA7 DRIVER but it's been 7 years since I've had access to CA7 so I don't know for sure. Find the CA7 DRIVER manual and read up on it.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2365
Location: Hampshire, UK

PostPosted: Thu Jun 18, 2020 12:15 am    Post subject: Reply to: How to filter out certain records based on current date
Reply with quote

Why not have 2 jobs - one to run on Christmas day and the other to run the rest of the time?
Back to top
View user's profile Send private message
Pete Wilson

Active User


Joined: 31 Dec 2009
Posts: 480
Location: London

PostPosted: Tue Jun 23, 2020 9:59 pm    Post subject:
Reply with quote

You have calendars in CA7, and can schedule with different CA7 JCL Include statements according to the calendar. So on Xmas day the include statement may bring in a SYSIN statement or PARM with different criteria.

Failing that you could have a rexx step that checks the day and generates a specific RC for Xmas day, which means subsequent steps may execute or not, based on the RC out of the rexx step.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 277
Location: Bamberg, Germany

PostPosted: Tue Jun 23, 2020 11:38 pm    Post subject: Re: How to filter out certain records based on current date
Reply with quote

manugeorge2004 wrote:
Is there a way in JCL where I can test in IF THEN statements to check for MMDD of current date and execute a different step.

You can try something like this:
Code:
//*
//*   - An IF statement specified before the first EXEC statement 
//*     in a job is not evaluated before the first step executes. 
//*                                                               
//INIT EXEC PGM=IEFBR14                                           
// IF (&LDAY. EQ 25 AND &LMON. EQ 12) THEN                         
//XMAS  EXEC PGM=IEFBR14                                           
// ELSE                                                           
//OTHER EXEC PGM=IEFBR14                                           
// ENDIF
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem while trying to manipulate re... amitc23 DFSORT/ICETOOL 3 Tue Jun 30, 2020 1:19 pm
No new posts Need to select all records belonging ... Q5P418 DB2 2 Mon Jun 22, 2020 11:34 pm
No new posts reffering the filename with date and ... skbk JCL & VSAM 9 Sat Jun 06, 2020 4:57 pm
No new posts Need to delete inactive records from ... Sanchayita Sinha DB2 5 Fri May 29, 2020 10:47 pm
No new posts Need SQL for two latest records havin... Q5P418 DB2 10 Sun May 10, 2020 8:24 am

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