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

how to send different parm value to program


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

New User


Joined: 11 Oct 2013
Posts: 37
Location: India

PostPosted: Sun Oct 27, 2013 2:33 pm
Reply with quote

Dear experts

I have a question.
How to send different parm values based on any condition to the program in a jcl
Example
if the time is before 12:00 pm. I want to send "a" to some program and if it is past 12:00. I want to send "B" as a parm value to that program.
How to do it thru jcl...



Deepak kumar
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Sun Oct 27, 2013 3:05 pm
Reply with quote

A couple of prolems here:
    you will code the parameter in the same way whatever the parameter value.
    JCL will not amend your values - you have to do it programmatically.
    What if the job is submitted with the "morining parameter" but does not run until the afternoon?

So you have a few more programming options:
    Use your sort product to create the parameter and submit the job with that parameter.
    Write your own program to do the same.
    Change the program that reads the parameter to deecide it self what they parameter should be.

You could also have two jobbs in the scheduler each with the appropriate parameter.
But if you just want to run "morning/afternoon/morning/afternoon" etc then a simple record with a flag would do.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Oct 29, 2013 11:07 pm
Reply with quote

And does this problem come from a real production environment per se or just a thought up thing?
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Wed Oct 30, 2013 3:54 am
Reply with quote

The following SORT JCL will create a one 80-byte record with the System time in the following format:
CTIME,'HH:MM:SS'

Maybe you/someone can create a Parm value based on Hour (column 8-9);
Something like...
Set Parm to 'A'
If Hour > 11, Parm is 'B'

Code:
//*-----------------------------------------------------------------
//*-- LIB:     'TEST.USER123.JCL'                                       
//*-- MEMBER:  SORTTIME                                             
//*-- PURPOSE: CREATE SPECIFIC TIME OR SYSTEM TIME IN FOLLOWING FORM
//*--    COL...----+----1----+----2                                 
//*--          CTIME,'HH:MM:SS'                                     
//*-- NOTES:   - USE OUTPUT FILE, FOR EXAMPLE, IN SORT INCLUDE     
//*--            INCLUDE COND=(49,8,CH,EQ,CTIME,OR,59,8,CH,EQ,CTIME)
//*--          - XXX                                               
//*-----------------------------------------------------------------
//*                                                                 
//SORTTIME EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SYMNOUT  DD SYSOUT=*                                             
//SYSPRINT DD SYSOUT=*                                             
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                     
12:23:56                                                           
/*                                                                 
//*               ----+----1----+----2                             
//*           IE. CTIME,'17:52:56'                                 
//SORTOUT  DD DSN=TEST.USER123.SORTTIME,                               
//            DISP=(NEW,CATLG,DELETE),                 T/STEP???
//            UNIT=(TEST,1),                                       
//            SPACE=(TRK,(1,1),RLSE),                               
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)                     
//* ----+----1----+----  SPECIFIC TIME EXAMPLE RUN AT 17:52:56     
//* CTIME,'12:34:56'                                               
//*                                                                 
//* ----+----1----+----  SYSTEM   TIME EXAMPLE RUN AT 17:52:56     
//* CTIME,'17:52:56'                                               
//*                                                                 
//*                                                                 
//*--- FOR SPECIFIC TIME, RUN USING THE FOLLOWING SETUP:           
//*--- USE "HH:MM:SS" FORMAT IN THE DD-SORTIN TIME BELOW.           
//*    ----+----1----+----2                                         
//*    //SYSIN    DD *                                             
//*      OPTION COPY                                               
//*      INREC IFTHEN=(WHEN=(1,5,CH,NE,C'CTIME'),               
//*        BUILD=(C'CTIME,''',1,8,C'''',80:X))                 
//*      OUTFIL ENDREC=1                                       
//*                                                             
//*--- FOR SYSTEM CURRENT TIME, RUN USING THE FOLLOWING SETUP: 
//*--- IGNORES THE DD-SORTIN TIME.                             
//*    ----+----1----+----2                                     
//*    //SYSIN    DD *                                         
//*      OPTION COPY                                           
//*      OUTREC BUILD=(C'CTIME,''',&TIME,C'''',80:X)           
//*      OUTFIL ENDREC=1                                       
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  OUTREC BUILD=(C'CTIME,''',&TIME,C'''',80:X)                   
  OUTFIL ENDREC=1                                               
/*                                                             
//     
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
No new posts Using API Gateway from CICS program CICS 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
No new posts Need to specify PARM='POSIX(ON) Java & MQSeries 4
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
Search our Forums:

Back to Top