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
 

 

Passsing A Parameter From A COBOL Program To My JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Passsing A Parameter From A COBOL Program To My JCL
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    Post subject: Re: Passsing A Parameter From A COBOL Program To My JCL
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    Post subject: Re: Passsing A Parameter From A COBOL Program To My JCL
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    Post subject: Re: Passsing A Parameter From A COBOL Program To My JCL
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    Post subject: Re: Passsing A Parameter From A COBOL Program To My JCL
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    Post subject: Re: Passsing A Parameter From A COBOL Program To My JCL
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    Post subject: Re: Passsing A Parameter From A COBOL Program To My JCL
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    Post subject: Re: Passsing A Parameter From A COBOL Program To My JCL
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    Post subject: Re: Passsing A Parameter From A COBOL Program To My JCL
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    Post subject: Re: Passsing A Parameter From A COBOL Program To My JCL
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    Post subject: Re: Passsing A Parameter From A COBOL Program To My JCL
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    Post subject: Re: Passsing A Parameter From A COBOL Program To My JCL
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    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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


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