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
 

 

how to send different parm value to program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: how to send different parm value to program
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: 1825
Location: UK

PostPosted: Sun Oct 27, 2013 3:05 pm    Post subject:
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

Senior Member


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

PostPosted: Tue Oct 29, 2013 11:07 pm    Post subject:
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    Post subject:
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    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 Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


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