View previous topic :: View next topic
|
Author |
Message |
sankar_MF
New User
Joined: 19 Sep 2006 Posts: 29
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
sankar_MF
New User
Joined: 19 Sep 2006 Posts: 29
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
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 |
|
|
sankar_MF
New User
Joined: 19 Sep 2006 Posts: 29
|
|
|
|
How can I apply the date value in the file to the query..... |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
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 |
|
|
|