View previous topic :: View next topic
|
Author |
Message |
webbs523
New User
Joined: 23 Sep 2006 Posts: 6
|
|
|
|
The user is going to enter a date of a file that they need. I am going to subtract that date from the current date to get the correct GDG that I need to send to them. How do I pass this GDG number from my COBOL program to my JCL.
ex. COBOL PROGRAM RESULTS: -3
JCL: CXTSP.OTP00.MYFILE(?)
How do I get the -3 into the ? |
|
Back to top |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
Probably as a variable?
Code: |
//MYJOB JOB (.....)
//*
// SET THEGEN=-3
//*
...
//MYDD DD DSN=CXTSP.OTP00.MYFILE(&THEGEN),DISP=SHR,...
...
|
|
|
Back to top |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
Two details that would be helpful are:
1. Where is this program going to be running? When I see the concept of users entering data, I think CICS or TSO/ISPF.
2. Is the output of this program the job? If not, how would YOU like to pass the information over? |
|
Back to top |
|
|
webbs523
New User
Joined: 23 Sep 2006 Posts: 6
|
|
|
|
The user will enter the date on a CICS screen. This will be updated on a VSAM file. I will create a batch program that reads the date of the file they want and I will subtract this from current date. If the answer isn't 0, I will need to add the negative (-) sign in front of the value.
Example:
User Enters : 09-21-2006
My Batch Program: 09-22-2006 - 09-21-2206 = 1; therefore I put a negative sign in front of the 1 and I need GDG -1
---------------------------------------------------------------------------------
Now, I need to pass this -1 somehow to the JCL, so I can FTP the -1 GDG to the user
I hope this helps you understand. Thanks! |
|
Back to top |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
I'm under the belief that FTP can handle a relative GDG directly in a put or get statement. Is it really necessary to reference the relative GDG in the job itself? |
|
Back to top |
|
|
webbs523
New User
Joined: 23 Sep 2006 Posts: 6
|
|
|
|
I need this to be an automated process. The user is going to be requesting these files often, and I don't want to manually do the FTP each time. |
|
Back to top |
|
|
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
I am able to think of 2 options:-
1.
Move -1 to RETURN-CODE
and in the JCL,
// SET THEGEN=RC
//MYDD DD DSN=CXTSP.OTP00.MYFILE(&THEGEN),DISP=SHR,...
2. Create the JCL in the BATCH program itself and submit it via the INTRDR. This should be an easier way of dealing with your requirement...
Hope this helps..
Regards. |
|
Back to top |
|
|
webbs523
New User
Joined: 23 Sep 2006 Posts: 6
|
|
|
|
I have tried the first option:
// SET THEGEN=RC
And I get the following results:
//MYDD DD DSN=CXTSP.OTP00.MYFILE(RC),DISP=SHR,...
It actually puts RC as the GDG. Do I need to put RC in quotes or something? I have tried several things and nothing seems to work. |
|
Back to top |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
I already stated this before, but:
1. Place this record:
// SET THEGEN=-3
as a member of a PDS, such as 'MY.PDS(THEGEN)'.
2. Make sure to include the allocation of MY.PDS in your job, and INCLUDE the variable definition:
//MYJOB JOB (...)
//*
// JCLLIB ORDER=MY.PDS
// INCLUDE MEMBER=THEGEN
3. Refer to the variable &THEGEN when needed:
//MYDD DD DSN=CXTSP.OTP00.MYFILE(&THEGEN),DISP=SHR,.... |
|
Back to top |
|
|
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
I think it all depends on the way your BASE GDG and its versions get named...
For Eg:-
Consider the following as the present versions you got :-
DLL.TX.SPFILE.DRSCOPY.G0289V00
DLL.TX.SPFILE.DRSCOPY.G0290V00
DLL.TX.SPFILE.DRSCOPY.G0291V00
DLL.TX.SPFILE.DRSCOPY.G0292V00
DLL.TX.SPFILE.DRSCOPY.G0293V00
DLL.TX.SPFILE.DRSCOPY.G0294V00
DLL.TX.SPFILE.DRSCOPY.G0295V00
DLL.TX.SPFILE.DRSCOPY.G0296V00
DLL.TX.SPFILE.DRSCOPY.G0297V00
DLL.TX.SPFILE.DRSCOPY.G0298V00
Now if you pass (-3), how will the JCL know what is the -3 version ? I am not sure about this alone ! |
|
Back to top |
|
|
webbs523
New User
Joined: 23 Sep 2006 Posts: 6
|
|
|
|
Well, the most recent version created is always 0
The one before that is -1
the one before that is -2
the one before that is -3
etc.....
therefore:
DLL.TX.SPFILE.DRSCOPY.G0289V00 = (-9)
DLL.TX.SPFILE.DRSCOPY.G0290V00 = (-8)
DLL.TX.SPFILE.DRSCOPY.G0291V00 = (-7)
DLL.TX.SPFILE.DRSCOPY.G0292V00 = (-6)
DLL.TX.SPFILE.DRSCOPY.G0293V00 = (-5)
DLL.TX.SPFILE.DRSCOPY.G0294V00 = (-4)
DLL.TX.SPFILE.DRSCOPY.G0295V00 = (-3)
DLL.TX.SPFILE.DRSCOPY.G0296V00 = (-2)
DLL.TX.SPFILE.DRSCOPY.G0297V00 = (-1)
DLL.TX.SPFILE.DRSCOPY.G0298V00 = (0)
I'm not sure I am following you? |
|
Back to top |
|
|
webbs523
New User
Joined: 23 Sep 2006 Posts: 6
|
|
|
|
Thanks Kevin!!!! It works!!!!!!!!!!!! |
|
Back to top |
|
|
|