Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
COBOL calling REXX calling LISTDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
Chessdude

New User


Joined: 28 Apr 2006
Posts: 4

PostPosted: Mon May 01, 2006 2:32 pm    Post subject: COBOL calling REXX calling LISTDS
Reply with quote

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
View user's profile Send private message
References
superk

Moderator Team Head


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

PostPosted: Mon May 01, 2006 4:01 pm    Post subject: Re: COBOL calling REXX calling LISTDS
Reply with quote

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
View user's profile Send private message
Chessdude

New User


Joined: 28 Apr 2006
Posts: 4

PostPosted: Mon May 01, 2006 5:03 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Chessdude

New User


Joined: 28 Apr 2006
Posts: 4

PostPosted: Mon May 08, 2006 6:21 pm    Post subject: Re: COBOL calling REXX calling LISTDS
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1