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

Using Symbolic Parameters in JCL


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

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Mon Mar 03, 2008 6:53 pm
Reply with quote

Hi I am using the following JCL for fetching current date records from Table1.

Code:
       
//S00100   EXEC PGM=IKJEFT01                                         
//STEPLIB  DD DSN=DB2C.SDSNLOAD,DISP=SHR                             
//         DD DSN=DB2C.SDSNEXIT,DISP=SHR                             
//SYSTSPRT DD SYSOUT=*                                               
//SYSPRINT DD SYSOUT=*                                               
//SYSPUNCH DD DUMMY                                                 
//SYSREC00 DD DSN=AAAA.BBB.CCC,                     
//            DISP=(,CATLG,)                         
//SYSTSIN  DD *                                                     
    DSN SYSTEM (DB2C)                                               
    RUN PROGRAM(DSNTIAUL) PLAN(DSNTIB51) LIB('DB2C.RUNLIB.LOAD') +   
        PARM('SQL')                                                 
    END                               
/*                                                   
//SYSIN    DD *                                     
   SELECT * FROM TABLE1     
    WHERE                                       
           EFFECTIVE_DT = CURRENT DATE WITH UR;                   
/*         


Now my requirements is, i don;t want use the keyword "current date". Instead I have to read the date from the ps file or any member of pds file which has the date in the following format mmddyyyy.

For examble, my file/member contains the date as 03032008, how can I use this date in place of current date as symbolic in the jcl.

Can u please provide me the Jcl steps for the same?

Thanks
Sankar
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 03, 2008 7:01 pm
Reply with quote

sankar_MF wrote:
... how can I use this date in place of current date as symbolic in the jcl.


You can't, but what you haven't made clear is why you'd want to? If the date value already exists in a dataset or PDS member, why can't you use that?

For example, just create the one record as needed:

Code:

           EFFECTIVE_DT = MMDDYYYY WITH UR;


and use it as part of the //SYSIN DD concatenation.

You might want to read 5.4.2.1 Defining and Nullifying JCL Symbols in the z/OS V1R9.0 MVS JCL Reference.
Back to top
View user's profile Send private message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Mon Mar 03, 2008 7:19 pm
Reply with quote

Hi,
Thanks for your reply.

Actually for the understanding puropose, i mentioned the query as a simple one. The actual query has 300 lines which uses the current date keyword in more than 10 places. i want to substitute the values in all these places.

Why i need this is, this is a daily job, it create some proble while fetching current date. if there is a delay in job running, the date gets changed.

So instead of using current date, i have to use the current date file.


Please suggest any other options for my requirement.

thanks
sankar
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Mar 03, 2008 7:32 pm
Reply with quote

sankar_MF wrote:
Hi,
Thanks for your reply.

Actually for the understanding puropose, i mentioned the query as a simple one. The actual query has 300 lines which uses the current date keyword in more than 10 places. i want to substitute the values in all these places.

Why i need this is, this is a daily job, it create some proble while fetching current date. if there is a delay in job running, the date gets changed.

So instead of using current date, i have to use the current date file.


Please suggest any other options for my requirement.

thanks
sankar



The query is NOT JCL so you can not use JCL symbolic substitution in it.
Back to top
View user's profile Send private message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Mon Mar 03, 2008 7:34 pm
Reply with quote

How can I apply the date value in the file to the query.....
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 03, 2008 7:36 pm
Reply with quote

I guess that I'd create the queries to use my own variable substitution process, where the queries would be written to use a static name, like curr_date_value, and them I'd pass those queries through a program which would convert every instance of curr_date_value to the value as specified in the dataset/PDS member.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Mon Mar 03, 2008 10:59 pm
Reply with quote

Instead of writing the date to a file, write it to a DB2 table. Then you can just use it right in your query. I won't say anything for performance, but it will accomplish what you need.

Code:

   SELECT * FROM TABLE1     
    WHERE                                       
           EFFECTIVE_DT = (SELECT C_DATE FROM TEMPDATE_T) WITH UR;     
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 Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts Injecting HTTPHEADER parameters in th... PL/I & Assembler 0
No new posts pass data as symbolic parameter from ... CLIST & REXX 2
No new posts passing symbolic parameters through d... JCL & VSAM 3
No new posts Trim values of parameters in JCL JCL & VSAM 2
Search our Forums:

Back to Top