MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing values from JCL to Cobol-DB2 Program
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Nancy
Beginner


Joined: 23 May 2003
Posts: 77
Topics: 26

PostPosted: Fri Apr 28, 2006 10:48 am    Post subject: Passing values from JCL to Cobol-DB2 Program Reply with quote

Hello,

Since it is something very common to pass the parameters from JCL to Cobol program, I did not want to put a query on this. But I am facing some problems with this, hence data is not getting populated in the Source Code. I really can't think of anything that can cause it.

This is how I am sending the values from JCL, my data is in DHBK.BLQSAM.PARMS, it is just (01,NOTERM=000+).
Code:

//SYSTSIN  DD DSN=TVB.SIBUT.CCLIB(DUN1),DISP=SHR       
//         DD DSN=DHBK.BLQSAM.PARMS,DISP=SHR 
//         DD DSN=TVB.SIBUT.CCLIB(SIBBA052),DISP=SHR   
//         DD DSN=TVB.SIBUT.CCLIB(END),DISP=SHR       

In the Cobol Program, I am receiving the data like ...
Code:

LINKAGE SECTION.                                     
                                                     
01  L-RUN-PARM.                                     
    03  L-RUN-LL                PIC S9(4) COMP.     
    03  L-RUN-DAYNO             PIC 9(2).           
    88  VALID-DAYNO-RANGE       VALUE 1 THRU 99.     
    03  FILLER                  PIC X(78).           

PROCEDURE DIVISION USING L-RUN-PARM.

But when I am displaying the Data, just after the Procedure Division, its all Low Values. I don't see anything wrong with the process. Please give your views.

Cheers
Nancy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Apr 28, 2006 11:47 am    Post subject: Reply with quote

Nancy,

Please search before posting . Check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=2456&highlight=parm

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nancy
Beginner


Joined: 23 May 2003
Posts: 77
Topics: 26

PostPosted: Fri Apr 28, 2006 11:51 am    Post subject: Reply with quote

Kolusu,

I am aware of the different ways of passing data from JCL to Source code and have done it by instream data in past. But I am not sure what is wrong with my JCL and Source Code so if you could have a look into that, would be great otherwise I will go with instream data option.

Thanks
Nancy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Apr 28, 2006 11:55 am    Post subject: Reply with quote

Nancy,

DB2 programs under Terminal Monitor Program IKJEFT01. so you need to pass the parameters via SYSTSIN DD statement and the last post(posted by bithead) in the link shows how to do it.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nancy
Beginner


Joined: 23 May 2003
Posts: 77
Topics: 26

PostPosted: Mon May 08, 2006 9:29 am    Post subject: Reply with quote

Kolusu,

I used ACCEPT verb in cobol program and received the values by Instream data thru the JCL. But that is not advisable here. I am trying to pass by SYSTSIN DD statement but that is also not working.

My values (01,NOTERM=000+ ) are stored in DHBK.BLQSAM.PARMS and it is given in Procedure as -

SYSTSIN DD DSN=&CCLIB(&DB2),DISP=SHR
DD DSN=DHBK.BLQSAM.PARMS,DISP=SHR
DD DSN=&CCLIB(SIBBA052),DISP=SHR
* DD DSN=&&PARMS,DISP=(OLD,DELETE)
* DD DSN=&CCLIB(SIBBA052),DISP=SHR
DD DSN=&CCLIB(END),DISP=SHR

Please suggest what is wrong with this. I've already explained how I am receiving the values in program.

Regards
Nancy
Back to top
View user's profile Send private message
Nancy
Beginner


Joined: 23 May 2003
Posts: 77
Topics: 26

PostPosted: Mon May 08, 2006 9:36 am    Post subject: Reply with quote

Just to update that when I am displaying L-RUN-PARM, it has Low Values and L-RUN-LL has Zeros.

Regards
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Mon May 08, 2006 11:41 am    Post subject: Reply with quote

Nancy,
Once you have run your job, check the output in SYTSPRT. It will have the commands that you have coded in SYSTSIN. Verify that it is similar to the one shown by Bithead link.

Also, since your program would (most probably) be LE compliant, ensure that the program parameters are before the slash so as to differentiate with LE runtime parameters.
_________________
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.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon May 08, 2006 1:59 pm    Post subject: Reply with quote

nancy,

Here is a sample pgm for you

Code:

WORKING-STORAGE SECTION.

01 WS-SYS-PARM-DATE   PIC X(10).

LINKAGE SECTION.                             
                                             
01 PARM-AREA.                               
   05 PARM-LENGTH           PIC S9(4) COMP. 
   05 L-PARM-DATE           PIC X(10).       
                                             
PROCEDURE DIVISION USING PARM-AREA.         

MOVE L-PARM-DATE  TO WS-SYS-PARM-DATE           
                                                 
DISPLAY 'THE LINKAGE DATE  :' WS-SYS-PARM-DATE   


JCL used to run this pgm

Code:

//STEP0100 EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSOUT   DD SYSOUT=*                 
//SYSPRINT DD SYSOUT=*                 
//SYSTSPRT DD SYSOUT=*                 
//SYSTSIN  DD *                         
 DSN SYSTEM(XXXX)                       
 RUN PROGRAM(pgmname)            -     
     PLAN(planname)              -     
     LIB('your.loadlib.pds')     -     
     PARMS('2005-08-08/')               
 END
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nancy
Beginner


Joined: 23 May 2003
Posts: 77
Topics: 26

PostPosted: Tue May 09, 2006 3:29 am    Post subject: Reply with quote

Cogito-Ergo-Sum & Kolusu,

Thanks for your help.
Now the PARM is passed to Cobol program when I am supplying a hardcoded value but I need to use a symbolic parameter in that. Please suggest a way to do that.

Regards
Nancy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue May 09, 2006 8:15 am    Post subject: Reply with quote

Quote:

Now the PARM is passed to Cobol program when I am supplying a hardcoded value but I need to use a symbolic parameter in that. Please suggest a way to do that.


You can NOT pass Symbolics to a pgm unless you generate the JCL to be run on the fly.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nancy
Beginner


Joined: 23 May 2003
Posts: 77
Topics: 26

PostPosted: Tue May 09, 2006 8:28 am    Post subject: Reply with quote

Ok, thanks for this info.

Cheers
Nancy
Back to top
View user's profile Send private message
Nancy
Beginner


Joined: 23 May 2003
Posts: 77
Topics: 26

PostPosted: Fri Jun 02, 2006 6:39 am    Post subject: Reply with quote

Kolusu,
What exactly your last message convey? I need to pass symbolic parameter to the Cobol-DB2 program because I cant change the values everytime.
Please help.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Jun 02, 2006 7:56 am    Post subject: Reply with quote

Nancy,

You canNOT pass symbolics to sysin/systsin i.e control cards . ex

Quote:

//SYSTSIN DD *
DSN SYSTEM(XXXX)
RUN PROGRAM(pgmname) -
PLAN(planname) -
LIB('your.loadlib.pds') -
PARMS(&rundate)
END
/*


Here rundate is the symbolic and JCL/utilities does not have the capability of translating the symbolics in control cards.

You need dyanically generate the symbolic you want to pass or generate the entire JCL. What exactly are you trying to pass as parm any way?

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nancy
Beginner


Joined: 23 May 2003
Posts: 77
Topics: 26

PostPosted: Fri Jun 02, 2006 8:01 am    Post subject: Reply with quote

Kolusu,

If you see my very first post, there I have mentioned the L-RUN-DAYNO that needs to be passed as the symbolic parm because it will have values from 01 to 99 so really difficult to change it at every run.

Regards
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Jun 02, 2006 8:05 am    Post subject: Reply with quote

Nancy,

What is the logic of generating the L-RUN-DAYNO ? Is it day of the year?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group