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

Passsing A Parameter From A COBOL Program To My JCL


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

New User


Joined: 23 Sep 2006
Posts: 6

PostPosted: Sat Sep 23, 2006 1:17 am
Reply with quote

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
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Sat Sep 23, 2006 1:49 am
Reply with quote

Probably as a variable?

Code:

//MYJOB JOB (.....)
//*
// SET THEGEN=-3
//*
...
//MYDD DD DSN=CXTSP.OTP00.MYFILE(&THEGEN),DISP=SHR,...
...
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Sat Sep 23, 2006 1:56 am
Reply with quote

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
View user's profile Send private message
webbs523

New User


Joined: 23 Sep 2006
Posts: 6

PostPosted: Sat Sep 23, 2006 2:04 am
Reply with quote

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
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Sat Sep 23, 2006 2:33 am
Reply with quote

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
View user's profile Send private message
webbs523

New User


Joined: 23 Sep 2006
Posts: 6

PostPosted: Mon Sep 25, 2006 6:27 pm
Reply with quote

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
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Mon Sep 25, 2006 8:43 pm
Reply with quote

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
View user's profile Send private message
webbs523

New User


Joined: 23 Sep 2006
Posts: 6

PostPosted: Mon Sep 25, 2006 8:46 pm
Reply with quote

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
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Mon Sep 25, 2006 9:07 pm
Reply with quote

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
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Mon Sep 25, 2006 9:19 pm
Reply with quote

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
View user's profile Send private message
webbs523

New User


Joined: 23 Sep 2006
Posts: 6

PostPosted: Mon Sep 25, 2006 9:24 pm
Reply with quote

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
View user's profile Send private message
webbs523

New User


Joined: 23 Sep 2006
Posts: 6

PostPosted: Thu Sep 28, 2006 2:13 am
Reply with quote

Thanks Kevin!!!! It works!!!!!!!!!!!!
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top