Highlighted
Absent Member.
Absent Member.
2337 views

Errors with a Remote Project with a program working with the RM/Cobol file handler

[Migrated content. Thread originally posted on 01 December 2011]

I'm working with Visual Cobol Eclipse. I have a Cobol Project with a Cobol program, that it's configured to work with the RM/COBOL File Handler. This works correctly; it only open a RM/COBOL data file, and read some data.

Then, I have created a new Cobol Remote Project ("provaRemot2") with the same Cobol Program ("PROVAMB5").
3936472 0 drwxrwxr-x 2 00550051 gdesa 256 Dec 1 10:50 .
3936480 4 drwxrwxrwx 3 00550051 gdesa 4096 Dec 1 11:31 ..
3936491 52 -rw-rw-r-- 1 00550051 gdesa 52480 Dec 1 10:50 PROVAMB5.
idy
3936498 12 -rw-rw-r-- 1 00550051 gdesa 9947 Dec 1 10:50 PROVAMB5.
o
3936479 28 -rwxrwxr-x 1 00550051 gdesa 26580 Dec 1 11:34 provaRemo
t2

But when I have tried to execute the program in the remote machine, I have found some strange problems...

The program works correctly when it opens this RM/COBOL data file:
3936489 64 -rw-rw-r-- 1 rootexp grootexp 65536 Dec 1 11:31 FCLIENTS_
RM

But it fails when it try to open this RM/COBOL data file:
3936489 64 -rw-rw-r-- 1 00550051 gdesa 65536 Dec 1 11:54 FCLIENTS_
RM
It returns the file status 30,22!!!

The files are identical. The only difference is the owner / group of the file.
What is the problem???? The two files have the same permissions...

Thank you
0 Likes
4 Replies
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

RE: Errors with a Remote Project with a program working with the RM/Cobol file handler

This seems like a permissions issue, however, an RM/COBOL 30,22 error indicates that you encountered a UNIX system error 22(Invalid argument).

On what platform are you running the remote program?

Did you configure the Vision file handler to return RM/COBOL I/O error codes? You can configure the Vision File Handler to return RM error codes by setting the following environment variables on the remote system:

CONVERTSTATUS=rmstat
COBCONFIG=cobconfig.cfg *> cobconfig.cfg is your MF COBOL run-time configuration file.

Then, in the cobconfig.cfg, set the following:
set ACU_LIBRARY=TRUE

Are you using C$RERR to get the extended error status? If so, could you post the full error code? It is possible that the extended error code could provide further information into what is causing this issue.

Do you encounter the same error if you run the program locally?

Does the error go away if you change the owner(chown) and change the group(chgrp) to match that of the other file?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Errors with a Remote Project with a program working with the RM/Cobol file handler

This seems like a permissions issue, however, an RM/COBOL 30,22 error indicates that you encountered a UNIX system error 22(Invalid argument).

On what platform are you running the remote program?

S.O.: AIX 6.1

Processor Type: PowerPC_POWER5
Processor Implementation Mode: POWER 5
Processor Version: PV_5_2
Number Of Processors: 1
Processor Clock Speed: 1900 MHz
CPU Type: 64-bit
Kernel Type: 64-bit


Did you configure the Vision file handler to return RM/COBOL I/O error codes? You can configure the Vision File Handler to return RM error codes by setting the following environment variables on the remote system:

CONVERTSTATUS=rmstat
COBCONFIG=cobconfig.cfg *> cobconfig.cfg is your MF COBOL run-time configuration file.

Then, in the cobconfig.cfg, set the following:
set ACU_LIBRARY=TRUE

Are you using C$RERR to get the extended error status? If so, could you post the full error code? It is possible that the extended error code could provide further information into what is causing this issue.

Yes. Here is a part of the code ...
....
    PROCEDURE DIVISION.     
       DECLARATIVES.
       CLIENTS-ERROR SECTION.
           USE AFTER ERROR PROCEDURE ON CLIENTS.
       A.
           IF NOT STAT-PANL-EOF
              CALL "C$RERR" USING ERROR-STATUS, error-text.                                                                     
              display "FILE ERROR:", ST-CLIENTS.   
              display "DATABASE ERROR:",  secondary-error.   
       END DECLARATIVES.       
    ....
         OPEN INPUT CLIENTS.
           IF   ST-CLIENTS IS NOT EQUAL '00'
           THEN DISPLAY 'ERROR OBRIR ARXIUS CLIENTS'
                DISPLAY  ST-CLIENTS
      *          PERFORM EXIT-99 THRU FI-EXIT-99
                GO TO FI-PROGRAMA
           ELSE NEXT SENTENCE.

And then the error shows ...

FILE ERROR:30
DATABASE ERROR:22

ERROR OBRIR ARXIUS CLIENTS
30


Do you encounter the same error if you run the program locally?
No; If I run the program in my local PC (Windows XP), it works correctly with the diferents files...


Does the error go away if you change the owner(chown) and change the group(chgrp) to match that of the other file?
If I change the owner/group file, 00550051/gdesa by rootexp/grootexp , the program works correctly




0 Likes
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

RE: Errors with a Remote Project with a program working with the RM/Cobol file handler

From the information that you have provided this, definitely, seems like a permissions issue. However, the error message does not appear to be correct. In this instance, it might be that you are either not getting the RM/COBOL error codes and are, instead, receiving the Visual COBOL status codes. There is also the possibility that there is some bug in the product that is causing incorrect RM/COBOL error codes to be returned.

Below is the call to C$RERR that you provided:

CALL "C$RERR" USING ERROR-STATUS, error-text.

How have you described the ERROR-STATUS data item? Is it a PIC X(4) or a PIC X(11) data item? If you declare ERROR-STATUS as a PIC X(11) data item, then, you can receive an extended error code that might provide further information about the error condition encountered.

Also, C$RERR only accepts one argument, however, it appears that you have two arguments, ERROR-STATUS and error-text. This potential syntax error might be causing the returning error to be incorrectly processed.

If this is, actually, some sort of permissions issue that is returning an erroneous status code, then, one way to avoid this issue would be to grant "others" both read and write permissions. For example:

chmod o+rw FCLIENTS_RM
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Errors with a Remote Project with a program working with the RM/Cobol file handler

I made the changes in the code concerning the use of C$RERR, then I changed the file permissions, and I finally returned to run the program ..

I have obtained the same results as in previous tests...

The program works correctly when it opens this RM/COBOL data file:
3936489 64 -rw-rw-r-- 1 rootexp grootexp 65536 Dec 1 11:31 FCLIENTS_
RM

But it fails when it try to open this RM/COBOL data file:
3936485 64 -rwxrwxrwx 1 00550051 gdesa 65536 Dec 9 11:44 FCLIENTS_
RM

Now, I get the next error

FILE ERROR:30                                                                   
DATABASE ERROR:,04,00022                                                       
ERROR OBRIR ARXIUS CLIENTS                                                     
30         


I execute the program from the AIX server with my user 00550051.
This is the program’s code..

$SET CALLFH("ACUFH")
       IDENTIFICATION DIVISION.
       PROGRAM-ID. FILEOPEN as "FILEOPEN".
      **************************************
       
       ENVIRONMENT DIVISION.
      *
       CONFIGURATION SECTION.

       SPECIAL-NAMES.
               DECIMAL-POINT IS COMMA.

       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
       
           SELECT CLIENTS ASSIGN TO "../provaRemot2/FCLIENTS_RM"
                          ORGANIZATION IS INDEXED
                          ACCESS MODE IS DYNAMIC
                          RECORD KEY I-CODI-CLIENT
                          ALTERNATE RECORD KEY I-DNI
                          ALTERNATE RECORD KEY I-NOM WITH DUPLICATES
                          FILE STATUS IS ST-CLIENTS.
     
      **************************************
     
       DATA DIVISION.

       FILE SECTION.       
       
       FD  CLIENTS LABEL RECORD STANDARD
           RECORD 92 CHARACTERS.
       
       01 REG-CLIENTS.
         02 I-CODI-CLIENT PIC 9(14).
         02 I-DNI         PIC X(12).
         02 I-NOM         PIC X(50).
         02 I-SALDO       PIC S9(12)V9(2) LEADING SEPARATE.
         02 I-TRASPASSAT  PIC X(1).

         
       WORKING-STORAGE SECTION.
       
       01  ERROR-STATUS.
           02 ST-CLIENTS         PIC XX.
              88 STAT-PANL-OK   VALUE "00".
              88 STAT-PANL-EOF  VALUE "10".
           02 SECONDARY-ERROR       PIC X(9).
       
       01  TROBAT      PIC X(1).
      **************************************
     
       PROCEDURE DIVISION.     
       DECLARATIVES.
       CLIENTS-ERROR SECTION.
           USE AFTER ERROR PROCEDURE ON CLIENTS.
       A.
           IF NOT STAT-PANL-EOF
              CALL "C$RERR" USING ERROR-STATUS.                                                                                 
              display "FILE ERROR:", ST-CLIENTS.   
              display "DATABASE ERROR:",  secondary-error.   
       END DECLARATIVES.       
       
      *----------
       PROGRAMA.
      *----------

            SET ENVIRONMENT "A_CONFIG" TO "acurmfm.cfg".     
      ****     
            OPEN INPUT CLIENTS.
            IF   ST-CLIENTS IS NOT EQUAL '00'
            THEN DISPLAY 'ERROR OBRIR ARXIUS CLIENTS'
                 DISPLAY  ST-CLIENTS     
                 GO TO FI-PROGRAMA
            ELSE NEXT SENTENCE.
      ****     
           MOVE "333" TO I-DNI.
           MOVE 'S' TO TROBAT.
           START CLIENTS KEY IS = I-DNI
              INVALID KEY MOVE 'N' TO TROBAT.

           IF   TROBAT = 'S'
           THEN READ CLIENTS NEXT RECORD
                AT END MOVE 'N' TO TROBAT
           ELSE NEXT SENTENCE.
           
            IF   TROBAT = 'S'
            THEN
                DISPLAY " "
                DISPLAY "   I-CODI-CLIENT: ", I-CODI-CLIENT
             DISPLAY "   I-DNI:         ", I-DNI
             DISPLAY "   I-NOM:         ", I-NOM
             DISPLAY "   I-SALDO:       ", I-SALDO
             DISPLAY "   I-TRASPASSAT:  ", I-TRASPASSAT
             DISPLAY " "
            END-IF.
      ****     
            CLOSE CLIENTS.
           
       FI-PROGRAMA.
            GOBACK.


Apart from this, one thing has happened to me that perhaps gives you a clue ...
As I had told you, this program is part of a Remote Cobol Project from Eclipse Windows Environment, and the executable is built from this platform.. And when I run the executable from AIX server, I get previous results...

But if I built the executable from the AIX with instruction ...
Cob –x FILEOPEN.CBLThe program works correctly with the two type of files!!!!!

There may be some problem with the executable generated from the Eclipse for a Remote Cobol Project????

Thank you
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.