IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

COBOL calling REXX calling LISTDS

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> CLIST & REXX
View previous topic :: View next topic  
Author Message
Chessdude



Joined: 28 Apr 2006
Posts: 4

Posted: Mon May 01, 2006 2:32 pm    Post subject: COBOL calling REXX calling LISTDS  

I'm calling REXX from COBOL with IRXEXEC which works fine.
I try to extract the member names from a PDS-file with LISTDS.
The relevant part of the REXX looks like this:

dsn = 'my.pds.filename'
x = OUTTRAP(listds.)
Address TSO "LISTDS '"dsn"' MEMBERS"
x = OUTTRAP('OFF')
r = ''
Do i = 7 to listds.0
member = STRIP(listds.i)
r = r','member
End
Return r

When I execute this REXX directly, r is filled with the member names I was looking for. The last line then gets an error "Invalid whole number" but that is another matter.

When called from COBOL I get an eror on LISTDS:
>O> "LISTDS 'my.pds.filename' MEMBERS"
+++ RC(-3) +++
and r will consist of ",LISTDS.7,LISTDS.8,......"

What am I missing here? Let me know if you need more information.
Back to top  
superk



Joined: 26 Apr 2004
Posts: 3381
Location: Charlotte,NC USA

Posted: Mon May 01, 2006 4:01 pm    Post subject: Re: COBOL calling REXX calling LISTDS  

Since LISTDS is only available in a REXX exec running in a TSO/E address space, are you executing your program within a TSO/E address space?
Back to top  
Chessdude



Joined: 28 Apr 2006
Posts: 4

Posted: Mon May 01, 2006 5:03 pm    Post subject:  

I thought I covered that with "Address TSO"!
I submit the JCL to run the COBOL program under MVS in a TSO environment.

Anyway the following statements:

say 'ENVIRONMENT is' address()
parse SOURCE env type file
say 'parse SOURCE returned' env type file

put in front of "dsn=..." give me:

ENVIRONMENT is TSO
parse SOURCE returned TSO SUBROUTINE IFM458L SYSEXEC ? IFM458L TSO TSO/E ?
Back to top  
Chessdude



Joined: 28 Apr 2006
Posts: 4

Posted: Mon May 08, 2006 6:21 pm    Post subject: Re: COBOL calling REXX calling LISTDS  

Another bit of information: in the cobol program I use IKJTSOEV to set up a TSO-environment for the REXX. Nevertheless no TSO-command or ISPF-command (after 'Address ISPF') will work.
Has anyone had any experience with this?
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> CLIST & REXX
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM