IBM MAINFRAME: Calling COBOL program from REXX -:::: Author Message airan1981 New User Joined: 11 Nov 2008 Location: Bentonville, AR US Posted: Sun Aug 09, 2009 3:31 am Post subject: Calling COBOL program from REXX Hi, I have a requirement where REXX calls a COBOL program and COBOL programs INTURNS calls COBOL. I am able to call the COBOL program from REXX but the COBOL program which is called from REXX calls another COBOL program give me message 'MODULE NOT FOUND' while making the call. I used the LIBDEF command to define the LOADLIBs where my COBOL program is present. DOes any body has idea how to resolve the issue? I searched over the GOOGLE and found that i need to define my LOADLIB thru TSOLIB but this works in TSO/E ready environment. I don't know how to invoke it.
The COBOL program is written using. Getting 4038 abend i have a cics-cobol-db2 as a main program. My main program is calling a subprogram which is a cobol-db2 program.
Pedro Senior Member Joined: 01 Sep 2006 Location: Silicon Valley Posted: Sun Aug 09, 2009 10:37 am Post subject: Reply to: Calling COBOL program from REXX What environment are you executing in? The LIBDEF only works for ISPF service calls.
If you require an ISPF environment then perhaps you can call the second cobol program through SELECT PGM( ). If you run in a batch job, add your loadlib to the STEPLIB concatenation. Airan1981 New User Joined: 11 Nov 2008 Location: Bentonville, AR US Posted: Sun Aug 09, 2009 6:55 pm Post subject: I am running in the iSPF environment.
Thats why, i can not add the loadLIB of COBOL program called from the COBOL program via REXX. How can i use SELECT PGM in REXX. Can you give me some example. Pedro Senior Member Joined: 01 Sep 2006 Location: Silicon Valley Posted: Sun Aug 09, 2009 10:02 pm Post subject: Reply to: Calling COBOL program from REXX Try using the TSO CALL command instead of SELECT PGM. Read the rexx reference manual for Address TSO and the TSO Commands Reference for the CALL command syntax. Dick scherrer Site Director Joined: 23 Nov 2006 Location: Inside the Matrix Posted: Mon Aug 10, 2009 1:48 am Post subject: Hello, Suggest you ask a co-worker. There are many qualified people on that system.
Airan1981 New User Joined: 11 Nov 2008 Location: Bentonville, AR US Posted: Mon Aug 10, 2009 6:56 pm Post subject: My cobol program is able to call the seocnd cobol program via REXX (Thru CALL and SELECT CMD). But, I can not receive back the return value in the REXX. I can pass the PARM thru TSO CALL but i dont know how to receive it back. When i display the variable which is being passed from the REXX to cobol gives me the same string passed after the call also.
I tried to find out, if there is any problem with the cobol and Its working fine. I think i need to do something additional to receive the return value back in my REXX. Airan1981 New User Joined: 11 Nov 2008 Location: Bentonville, AR US Posted: Mon Aug 10, 2009 7:26 pm Post subject: The SELECT PGM also gives the same problem like 'MODULE NOT FOUND' SELECT CMD and TSO CALL is working fine but I am not able to receive back the result in the REXX. Pedro Senior Member Joined: 01 Sep 2006 Location: Silicon Valley Posted: Tue Aug 11, 2009 2:02 am Post subject: Reply to: Calling COBOL program from REXX RC is a built-in variable that has the last return code. Code: /. REXX./ ADDRESS TSO 'CALL 'SYS1.LINKLIB(ISPQRY)' SAY 'Return Code='RC Pedro Senior Member Joined: 01 Sep 2006 Location: Silicon Valley Posted: Tue Aug 11, 2009 2:09 am Post subject: Reply to: Calling COBOL program from REXX You may want to change your COBOL program to use ISPF's VGET and VPUT services to share variables with the rexx program.
Superk Moderator Team Head Joined: 26 Apr 2004 Location: Raleigh, NC, USA Posted: Tue Aug 11, 2009 2:10 am Post subject: Reply to: Calling COBOL program from REXX You know, your original post never mentioned that you wanted to call a COBOL program and then return results back to your calling REXX code. I've never done that process, so I don't know how exactly it would be done from within a TSO or ISPF address space. In a regular REXX exec running in batch (PGM=IRXJCL) you can use the ADDRESS LINKMVS command to do what you want.
Since you're running these from within the ISPF address space, have you tried just using ISPF shared variables (i.e. Using VPUT and VGET services) as a means of passing data back and forth?
Daveporcelan Active Member Joined: 01 Dec 2006 Location: Pennsylvania Posted: Tue Aug 11, 2009 2:19 am Post subject: Reply to: Calling COBOL program from REXX I had a similar experience. I used the LINKPGM command to make the call, but it may not change what is required to receive a return value. What I found was that the length of the LINKAGE section passed from the REXX is all that would be received regardless of what was defined in the COBOL program. For example if I passed twenty bytes of data from REXX, I would only receive twenty bytes back even though the COBOL was returning forty bytes. To remedy this I used the following: LINKAGE = LEFT(LINKAGE,39,' ') '0' Forcing a non-space in the 40th position established the length I needed. I was now able to receive all forty bytes from my COBOL. This was my experience, I hope it works for you.
Enrico-sorichetti Senior Member Joined: 14 Mar 2007 Location: italy Posted: Tue Aug 11, 2009 2:22 am Post subject: Reply to: Calling COBOL program from REXX see:::: - All times are GMT + 6 Hours Page 1 of 1 Search our Forum.
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |