IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COBOL calling REXX calling LISTDS


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Chessdude

New User


Joined: 28 Apr 2006
Posts: 6
Location: Netherlands

PostPosted: Mon May 01, 2006 2:32 pm
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
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon May 01, 2006 4:01 pm
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: 6
Location: Netherlands

PostPosted: Mon May 01, 2006 5:03 pm
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: 6
Location: Netherlands

PostPosted: Mon May 08, 2006 6:21 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
Search our Forums:

Back to Top