IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to filter out certain records based on current date


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manugeorge2004

New User


Joined: 17 Jun 2009
Posts: 38
Location: Denver

PostPosted: Wed Jun 17, 2020 10:05 pm
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
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1201

PostPosted: Wed Jun 17, 2020 11:15 pm
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: 8584
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 17, 2020 11:37 pm
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: 2455
Location: Hampshire, UK

PostPosted: Thu Jun 18, 2020 12:15 am
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 Member


Joined: 31 Dec 2009
Posts: 508
Location: London

PostPosted: Tue Jun 23, 2020 9:59 pm
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 Member


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

PostPosted: Tue Jun 23, 2020 11:38 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Sort to include records of file 2 int... Java & MQSeries 1
No new posts SORT for dynamic trailer record + CSV... DFSORT/ICETOOL 14
No new posts Cobol program to determine the sequen... COBOL Programming 2
No new posts Merge a variable number of records fr... DFSORT/ICETOOL 5
No new posts SORT HELP - SORT A COLUMN and GROUP B... DFSORT/ICETOOL 9
Search our Forums:

Back to Top