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

BPX1OPN Help


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jefflance1

New User


Joined: 05 May 2007
Posts: 4
Location: Birmingham, AL

PostPosted: Fri Jul 02, 2010 12:46 am
Reply with quote

I have been working with this call routine on and off for a few days now and I can't seem to get it to work. My call goes out and gets a good return code (0) and reason code (0) but my return value is all low values. I read the documentation and it says the return value should have the file descriptor value in it so I'm puzzled as to why this thing isn't giving me back the file descriptor value. I am pasting my code in so someone can see what I am doing and hopefully point out what I am doing wrong here. Thanks in advance for any help. I should also mention that I am trying to open the file for read only.

Code:
01  LEN                   PIC S9(8) COMP VALUE 36.
01  PATH                  PIC X(36)
    VALUE '/home/app/dev/jeff/webpage/Hello.htm'.
01  OPT                   PIC X(4) VALUE X'00000402'.
01  MODEP                 PIC X(4) VALUE X'00000000'.
01  RET-VAL               PIC S9(9) COMP.
01  READ-VAL              PIC S9(8) COMP.
01  RET-CODE              PIC S9(8) COMP.
01  REASON                PIC S9(8) COMP.
01  BUF-ALET              PIC S9(8) COMP VALUE 0.
01  READ-CNT              PIC S9(8) COMP VALUE 80.

CALL 'BPX1OPN' USING
   LEN, PATH, OPT, MODEP, RET-VAL, RET-CODE, REASON
DISPLAY 'RET-VAL = ' RET-VAL
DISPLAY 'RET-CODE = ' RET-CODE
DISPLAY 'REASON = ' REASON
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Jul 02, 2010 1:11 am
Reply with quote

What did RETVAL display (in hex) as?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 02, 2010 1:17 am
Reply with quote

This code is based upon yours and read the first bytes from the file:
Code:
       01  LEN                         PIC S9(08) COMP VALUE 26.
       01  PATH                        PIC X(26)
           VALUE '/u/tech/ttssrs0/books.text'.
       01  OPT                         PIC X(04) VALUE X'00000402'.
       01  MODEP                       PIC X(04) VALUE X'000001F8'.
       01  RET-VAL                     PIC S9(09) COMP.
       01  READ-VAL                    PIC S9(08) COMP.
       01  RET-CODE                    PIC S9(08) COMP.
       01  REASON                      PIC S9(08) COMP.
       01  BUF-ALET                    PIC S9(08) COMP VALUE 0.
       01  READ-CNT                    PIC S9(08) COMP VALUE 80.
       01  BUF-PTR                     USAGE POINTER.
       01  BUF-INPUT                   PIC X(100).
       PROCEDURE DIVISION.
       MAIN-PARA.
           CALL 'BPX1OPN' USING
           LEN, PATH, OPT, MODEP, RET-VAL, RET-CODE, REASON .
           DISPLAY 'RET-VAL  = ' RET-VAL.
           DISPLAY 'RET-CODE = ' RET-CODE.
           DISPLAY 'REASON   = ' REASON.

           SET BUF-PTR TO ADDRESS OF BUF-INPUT.
           CALL 'BPX1RED' USING
           RET-VAL, BUF-PTR, BUF-ALET, READ-CNT,
                    READ-VAL, RET-CODE .
           DISPLAY 'READ-VAL = ' READ-VAL .
           DISPLAY 'READ-CNT = ' READ-CNT .
           DISPLAY 'BUF-INPUT  ' BUF-INPUT.
           DISPLAY 'RET-CODE = ' RET-CODE.
I set the MODEP parameter for universal access.
Back to top
View user's profile Send private message
jefflance1

New User


Joined: 05 May 2007
Posts: 4
Location: Birmingham, AL

PostPosted: Fri Jul 02, 2010 1:24 am
Reply with quote

CICS Guy, I'm getting low values for retval or in hex 00000000. Knowing that this work's for you Robert, is it possible something isn't set up correctly in my hfs? I'm at a loss here trying to grasp at straws.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Jul 02, 2010 1:43 am
Reply with quote

Well, maybe the problem is in your flags in MODEP....
BPXYMODE — Map the mode constants of the file services
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 02, 2010 4:01 am
Reply with quote

Try the MODEP values -- they can make a difference.
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 -> COBOL Programming

 


Search our Forums:

Back to Top