Posted: Tue Jul 08, 2003 3:06 am Post subject: Date in JCL.
Hi people,
I need to find out if there is any method to determine the current date in a JCL on which the job is going to be run and pass that value as one the DSN qualifier.
Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
Posted: Tue Jul 08, 2003 6:17 am Post subject:
Meg,
Does your shop has any job scheduling packages available? If so you will be able to achieve appending the date as a DSN qualifier.Another alternative is to create the file and rename the file with the current date using SORT/IKJEFT01
Joined: 12 Feb 2003 Posts: 358 Topics: 4 Location: Israel
Posted: Tue Jul 08, 2003 6:21 am Post subject:
Meg -
I did something like this in two steps:
1 - Run REXX to generate a member that includes the desired DSN with current date.
2 - The second step uses the 'INCLUDE' statement, that includes the member generated in previous step.
Yes, in our case the job is is scheduled by CA7 scheduler. Can you please let me know how this is done. Also I want to know about the alternative method too. I would like to know how can we get the current date sing SORT/IKJEFT01.
In the above code, the first step will write a JCL record as
Code:
//DDNAME DD DSN=HLQ.MLQ.Dyymmdd,
This will be included for the IEFBR14 step in the second step for allocation. Of course, step 2 can be anything.
I did not post for the following reasons.
For a non-existing member DATE, it seems, a new member by the name of DATE is not being allocated. Hence, in IEFBR14 the INCLUDE is not getting expanded.
For an existing member DATE, I get a message saying, expected continuation not recieved.
What am I missing? _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Joined: 04 May 2003 Posts: 92 Topics: 4 Location: Paris, France
Posted: Tue Jul 08, 2003 11:48 am Post subject:
Cogito,
In fact it's quiet simple.
As you know the INCLUDE statement requires a member that must exist
in the JCLLIB. This library has to be catalogued.
When you submit the JCL, all the cards are interpreted before execution.
It means that the member must be found and what you have in must respond to the JCL requirements. That's why you have a JCL ERROR at the first submit. This abend is typically representative of an unresolved jCL statement. In other words, it means that unfortunally the DFSORT step
can't be executed, so the member is not found.
Now if you only submit the first step, then the second, it would work if you put all the step in the member. If not the JCL interpreter don't find the coma after DATE...
Even you do this you have to take care of one thing : the name of the file you will create with IEFBR14 is NOT the image of what you think there is in the member DATE.
Test this : submit the both steps, modify by hand the DSN you have created in the member. Re-submit the entire JCL; go and see what the interpreter has done. You will surprised.
The conclusion : you have to submit two jcl one after the other.
Alain
Last edited by Alain Benveniste on Tue Jul 08, 2003 3:43 pm; edited 1 time in total
Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
Posted: Tue Jul 08, 2003 2:46 pm Post subject:
Meg,
The following DFSORT/ICETOOL job will give you the desired results.If you have syncsort at your shop change the pgm name to SYNCTOOL.A brief explanation of the job.I am assumingng that your dsn name is "YOUR DSN NAME". Now this dataset will be created as
"YOUR DSN NAME.DMMDDYY". you cannot have a number as starting qualifier. so the for the date I used the alphapet D followed by 2 digit month followed by 2 digit day followed by 2 digit year.The first copy step takes in the system date in the format (MM/DD/CCYY) format and writes it to temp dataset. The second copy operator takes in the temp date file and creates rename cards as follows.
Code:
REN 'YOUR DSN NAME' -
'YOUR DSN NAME.D070803'
Now the above rename cards can be used as sysin cards for IKJEFT01. see step0200 for the jcl which will actually rename the dataset with current date.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Jul 08, 2003 4:33 pm Post subject:
If you have DFSORT, you can use the following alternate versions of Kolusu's ICETOOL jobs. These jobs only use one COPY operator instead of two. They use DFSORT Symbols to make it easier to specify and change your data set name. The second job also uses DFSORT Symbols for the IEFBR14 JCL statements to make them easier to specify and change. TRAILER1 with DATENS=(MDY) is used instead of HEADER1 with DATE=(MDY/) so we don't have to generate and remove the /.
To change the data set name, just change the DSN symbol in SYMNAMES.
To change any of the JCL statements, just change the corresponding Jx symbol in SYMNAMES. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Tue Jul 08, 2003 11:08 pm Post subject:
Alain,
Thanks for the explanation. I was thinking that, ICETOOL will create the member in the first step and this would be used in expansion for the second step.
Do you mean to say that, after modification "by hand", the dataset name that is created will still have the date stamp on it? If yes, then I do agree. Because, in the first submission (of first step), the PDS member will be created. And, in the second run, (whole of the JCL can be submitted as the PDS member is already existing) the PDS member will have the date stamp created by ICETOOL. So, manual modificaiton will not be reflected.
Thanks Alain. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum