HP3000-L Archives

May 2008, Week 5

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Francois Desrochers <[log in to unmask]>
Reply To:
Francois Desrochers <[log in to unmask]>
Date:
Thu, 29 May 2008 08:07:11 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (74 lines)
Once you have decoded the second character of the file status (see other postings) into a proper numeric variable, you can pass it to FERRMSG to retrieve the message text.

 FD  OUTPUT-FILE
    DATA RECORD IS OUTPUT-RECORD.
 01  OUTPUT-RECORD              pic x(80).

 01 OUTPUT-FILE-STATUS.
    05 output-file-status1   PIC X(01) VALUE SPACES.
    05 output-file-status2   PIC X(01) VALUE SPACES.
 01 ferrmsg-area.
    05 Fcheck-Error           pic s9(04) comp value 0.
    05 ferrmsg-text           pic  x(80) value spaces.
    05 ferrmsg-length         pic s9(04) comp value 0.

   IF OUTPUT-FILE-STATUS NOT = "00" THEN
      DISPLAY "Fopen failed with status " OUTPUT-FILE-STATUS
      if output-file-status1 = "9" then
         compute fcheck-error =
            function ord(output-file-status2) - 1
         display "File status2 " Fcheck-Error
         MOVE 80 TO FERRMSG-LENGTH
         CALL INTRINSIC "FERRMSG" USING FCHECK-ERROR
                                        FERRMSG-TEXT
                                        FERRMSG-LENGTH
         DISPLAY "Fserror: " ferrmsg-text(1:ferrmsg-length)
    END-IF
      STOP RUN
   END-IF.

This sample code will display:
 
Open failed with status 94
File status2 +0052
Fserror: NONEXISTENT PERMANENT FILE  (FSERR 52)

Open failed with status 9]
File status2 +0093
Fserror: SECURITY VIOLATION  (FSERR 93)

Thanks...François

-----Original Message-----
From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On Behalf Of Walter J. Murray
Sent: Thursday, May 29, 2008 12:10 AM
To: [log in to unmask]
Subject: Re: [HP3000-L] file status error number 9

Brian writes:

> The Cobol manual isn't very good at giving away these error codes
> and their meaning. 

Try the HP COBOL II/XL Programmer's Guide.  Read the section titled
"File Status Codes" on the chapter titled "Files".

For status 9x errors, you need a list of the file system error codes,
which can be found in a number of places.  For example, try the
Intrinsics Reference Manual, under the FCHECK intrinsic.

Walter  

Walter J. Murray

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html * 
 
Remarque - Cette transmission est pour l'usage exclusif du ou des destinataires indiqués et peut contenir de l'information confidentielle ou protégée. Si vous n'êtes pas le destinataire indiqué, veuillez supprimer cette transmission ainsi que tout fichier joint et aviser l'expéditeur par courriel immédiatement. Toute révision, utilisation, divulgation ou distribution non autorisée est interdite.
 
 
Notice: This transmission is for the sole use of the intended recipient(s) and may contain information that is confidential and/or privileged.  If you are not the intended recipient, please delete this transmission and any attachments and notify the sender by return email immediately.  Any unauthorized review, use, disclosure or distribution is prohibited.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2