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
 
How to use files in Cobol called from REXX?

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

New User


Joined: 25 May 2009
Posts: 9
Location: INDIA

PostPosted: Sat Jun 20, 2009 7:16 pm    Post subject: How to use files in Cobol called from REXX?
Reply with quote

Hi,

I have the following scenario. The REXX program is executing a COBOL program and this COBOL program need to use files.

Is it possible to use it? If so how?

When I try to execute the Cobol thru the REXX, I am getting the file status as 35.

Here is the code.

ADDRESS TSO "ALLOCATE DDNAME(FORMUSER) DSNAME("DATASET1") OLD"
ADDRESS TSO "ALLOCATE DDNAME(MOVTOS) DSNAME("DATASET2") OLD"

"ISPEXEC SELECT PGM(B099M601)"

Any help is Welcome!
Back to top
View user's profile Send private message
References
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 4249
Location: Atlanta, GA

PostPosted: Sat Jun 20, 2009 8:23 pm    Post subject:
Reply with quote

Did you look up the file status 35 either in the manual or via the sticky? And posting the REXX code doesn't really help without the COBOL file assignments, you know.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 3385
Location: germany

PostPosted: Sat Jun 20, 2009 8:24 pm    Post subject:
Reply with quote

Quote:
An OPEN statement with the INPUT, I-O,
or EXTEND phrase was attempted on a
non-optional file that was not present.


how do you expect us to determine why the COBOL program is returning a file_status of 35 when
  • you do not inform us of the rc for the alloc in your rexx
  • you have not provided the select, fd or I/O statements from the COBOL program
  • you have not provided the complete error message which would have indicated which file returned the 35 status
?????????????

by the way, you are invoking a COBOL program from a REXX Script; the OP-SYS executes the program.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 3385
Location: germany

PostPosted: Sat Jun 20, 2009 10:37 pm    Post subject:
Reply with quote

my money is on a bad alloc.
Back to top
View user's profile Send private message
A Selvakumar

New User


Joined: 25 May 2009
Posts: 9
Location: INDIA

PostPosted: Sun Jun 21, 2009 3:34 pm    Post subject: Reply to: How to use files in Cobol called from REXX?
Reply with quote

Hi,

I am getting the file status '35' for the FORMUSER file.

The RC from the REXX is zero after the allocation.

Here is the code from the Cobol program.

SELECT FORMUSER-FILE ASSIGN TO FORMUSER
ORGANIZATION IS INDEXED
ACCESS IS RANDOM
RECORD KEY IS FU-A-KEY
FILE STATUS IS FU-STATUS.


FD FORMUSER-FILE.
01 FORMUSER-RECORD.
03 FORMUSER-A-RECORD.
05 FU-A-KEY.
10 FU-A-REC-TYPE PIC X(01).
10 FILLER PIC X(06).
10 FILLER PIC X(05).
05 FU-A-DATA.
10 FU-A-SYS-NAME PIC X(06) OCCURS 10 TIMES.
10 FILLER PIC X(2460).

Procedure division code

MOVE 'A' TO FU-A-REC-TYPE
READ FORMUSER-FILE.

I am getting the error '35' while doing the open itself. I have seen the meaning of filestatus '35'.

The point here is, I am doing the allocation in the REXX code itself and then I am calling the Cobol program. This Cobol program is trying to use the same file.

Will this work?

Any help is welcome!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 4249
Location: Atlanta, GA

PostPosted: Sun Jun 21, 2009 7:39 pm    Post subject:
Reply with quote

Out of curiosity: you know that the file status 35 refers to the OPEN statement, yet that is the one piece of COBOL code you do NOT provide. Why?
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