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
 

 

Using Symbolic Parameters in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Using Symbolic Parameters in JCL
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

Moderator Team Head


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

PostPosted: Mon Mar 03, 2008 7:01 pm    Post subject: Re: Using Symbolic Parameters in JCL
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    Post subject: Reply to: Using Symbolic Parameters in JCL
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    Post subject: Re: Reply to: Using Symbolic Parameters in JCL
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    Post subject: Reply to: Using Symbolic Parameters in JCL
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

Moderator Team Head


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

PostPosted: Mon Mar 03, 2008 7:36 pm    Post subject: Reply to: Using Symbolic Parameters in JCL
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    Post subject:
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    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 CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts Multiple parameters Csongor All Other Mainframe Topics 16 Thu Jun 09, 2016 7:54 pm
No new posts SYSUT2 - CONFLICTING DCB PARAMETERS raulravi7 JCL & VSAM 6 Thu May 19, 2016 9:43 am
This topic is locked: you cannot edit posts or make replies. Put quotes in Symbolic parameter whil... Yashashri All Other Mainframe Topics 7 Mon Feb 15, 2016 12:24 pm


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