View previous topic :: View next topic
|
Author |
Message |
Mahesh P
New User
Joined: 16 Jan 2012 Posts: 7 Location: India
|
|
|
|
Hi,
Could you please let me know how to call a Cobol/DB2 sub-program from a REXX exec. I am not sure how to
1. Pass the Plan and the DB2 subsystem to the sub-program.
There are other parameters to be passed to the sub-program and received too. So, I need to somehow call a Cobol/DB2 sub-program
1. and pass the correct PLAN and DB2 subsystem parms
2. Also pass certain input parms and recieve the output.
Could you please help? I did a search in the forum. But could not locate any sample or any direction.
Regards,
Mahesh |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
is it an existing program ? |
|
Back to top |
|
|
Mahesh P
New User
Joined: 16 Jan 2012 Posts: 7 Location: India
|
|
|
|
yes, this is an existing program Enrico. Need to test it as an independent entity. Passing parms and receiving the result without coding a new applicaton as a whole. |
|
Back to top |
|
|
Mahesh P
New User
Joined: 16 Jan 2012 Posts: 7 Location: India
|
|
|
|
Hi,
I tried using the CALL subfunction using the below command. This gives me return code of 0.
DB2PARM='DB2=DSN1,PLAN=ABCDEFG'
TRACE I
ADDRESS TSO "CALL 'XXXXX.YYYYY.ZZZZZ(PGMNAM)' 'DB2PARM'"
SAY RC
But, I do not know
1. whether it got executed
2. how to pass rest of the parms
3. I can base it on the value in the return parms.
Please let me know how to use this properly. or should I use some other function like LINKPGM, LINKMVS etc?
Regards,
Mahesh |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Try:
Code: |
Queue "RUN PROGRAM(progname) PARM('p1 p2') PLAN(planname) LIB(proglib)"
Queue "END"
Address TSO "DSN SYSTEM(DB2Name)" |
|
|
Back to top |
|
|
Mahesh P
New User
Joined: 16 Jan 2012 Posts: 7 Location: India
|
|
|
|
I have been trying this from morning, but when I execute the ADDRESS TSO "DSN SYSTEM (DSN1)" command, it gives me the error COMMAND DSN NOT FOUND and gives me a return code of -3. Could you please let me know why?
Regards,
Mahesh |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
are you using the proper JCL class? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
Back to top |
|
|
Mahesh P
New User
Joined: 16 Jan 2012 Posts: 7 Location: India
|
|
|
|
Hi gylbharat - I am trying to run this using the EXec command from 3.4. I am not using jcls. I know where my DSN command is in. But I need to know how to allocate the PDS in th REXX code so that it understands where to search for the DSN command.
Is that the issue? if yes, how do I solve it?
Regards,
Mahesh |
|
Back to top |
|
|
Mahesh P
New User
Joined: 16 Jan 2012 Posts: 7 Location: India
|
|
|
|
Sorry if I have been too ambiguous. My requirements are
1. Run an already existing Cobol/Db2 subprogram from my REXX exec - online (Using 3.4, execute it using the Ex command).
2. I need to know how to pass parms to it and also to pass the PLAN name.
3. the routine does return some values for the REXX to process
4. currenly I am trying to execute it using ADDRESS TSO "DSN SYSTEM(DSN1)" command (as per an above post), but when executing it gives me the error - COMMAND DSN not found. I need the REXX to search in a particular library to find this. but not sure how to specify the library. I know the library name.
Please help.
regards,
Mahesh |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
How about
Code: |
Address TSO "CALL 'some.loadlib(YourPgm)' " |
or using LINKMVS as
Code: |
* REXX */
Address LINKMVS "YourPgm PARAMETERS" |
|
|
Back to top |
|
|
Mahesh P
New User
Joined: 16 Jan 2012 Posts: 7 Location: India
|
|
|
|
Hello Anuj - thanks for the reply. but I need to specifically know how to pass my PLAN and the DB2 subsystem name to this sub-program?
I have to pass this and also pass parms and recieve them back
Regards,
Mahesh |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Mahesh P wrote: |
I have been trying this from morning, but when I execute the ADDRESS TSO "DSN SYSTEM (DSN1)" command, it gives me the error COMMAND DSN NOT FOUND and gives me a return code of -3. Could you please let me know why?
Regards,
Mahesh |
Copy and paste the trace from your exec into this thread, being sure to use the Code tags. |
|
Back to top |
|
|
|