Passing a variable parm from JCL to a cobol/db2 program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Passing a variable parm from JCL to a cobol/db2 program

Postby paolinux » Fri Jul 10, 2009 7:57 pm

Hi everybody ,
I'm new here and I need some help(that's the reason I'm here :D )
I'm trying to write a batch cobol/db2 pgm wich receive in linkage section some paremeters.
I succeeded to pass a static string of characters but what I need is variable parameters.
I tried declaring the parameter in the CA7 job but I have to use them inside a SYSTSIN * like this
DSN SYSTEM(SDIA)                                             
    RUN  PROGRAM (ZWAC200) PLAN (ZWAC200)-                   
    PARMS('&PAR1,&PAR2,&PAR3,&PAR4,&PAR5,&PAR6,&PAR7,&PAR8') 
END


The problem is that when I run the job the JCL returns an error becaues it doesn't see that I'm using the parameters I've declared.
The error is :
3 IEFC657I THE SYMBOL PAR1 WAS NOT USED


Do you think there's a way to do what I'm trying or it's better to think to something else ?
paolinux
 
Posts: 2
Joined: Fri Jul 10, 2009 7:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Passing a variable parm from JCL to a cobol/db2 program

Postby MrSpock » Fri Jul 10, 2009 8:20 pm

I'm certainly not a CA-7 expert. Does it know how to perform variable substitution if the variables are located in the data, as your example shows, instead of in the JCL? My gut feeling is that it wouldn't perform a variable substitution on data since that could easily cause a data integrity problem.

I'd recommend that you move your variables out into the JCL (as specified in a PARM= statement) as input to a program, and have that program accept the parameters as input and write them out to a simple 80-byte FB dataset that you can specify as input to the SYSTSIN DD statement.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Passing a variable parm from JCL to a cobol/db2 program

Postby paolinux » Fri Jul 10, 2009 9:05 pm

Yes, this is my second option :) .
The CA7 can make the substitution but it seems that i'ts not possibile to pass dynamic parameters to to DB2 systsyn dd statement. For wath I've seen I can olny pass a static string to a DB2 program.
I'm not sure that it's possibile to do what I'm trying to do but I was hoping to find a easier way out ;)
Thanks, anyway.
paolinux
 
Posts: 2
Joined: Fri Jul 10, 2009 7:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Passing a variable parm from JCL to a cobol/db2 program

Postby dick scherrer » Sat Jul 11, 2009 1:23 am

Hello,

You might consider running a program* that used symbolic variables in the parm and then generate the static parm for use with the db2 program. The posted DSN...END appear to be inline, but could also be in some member that was re-created from dynamic variables.

* this would be a very small bit of code that processed the parm and wrote the DSN...END with the actual values from the symbolic parameter(s).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post