HP3000-L Archives

February 1997, Week 2

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:
"Chuck Duncan." <[log in to unmask]>
Reply To:
Date:
Wed, 12 Feb 1997 00:44:31 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (50 lines)
Kevin writes:

> I am looking for an intrinsic that I can call from a COBOL program
> to determine if a printer device exists.  We need to allow our users to
> enter a device name on a view form.  Does anyone know of such a beast?

In order to validate the users input to insure that the device that was
entered is a valid spooled device (or at least currently spooled), I have
used FFILEINFO item 38 and 78 as follows:

     SELECT PRINTER-FILE ASSIGN TO "REPORT" USING PRINTER-FILE-NAME
                                      FILE STATUS PRINTER-FILE-STATUS.

 01 PRINTER-FILE-STATUS  PIC X(02) VALUE SPACES.
 01 SPOOLED-38           PIC S9(4) VALUE ZEROS COMP.
 01 SPOOLED-78           PIC S9(9) VALUE ZEROS COMP.

    do the file equate and checking first
    OPEN OUTPUT PRINTER-FILE
    IF PRINTER-FILE-STATUS = "00"
    THEN
            MOVE ZEROS TO SPOOLED-38
            MOVE ZEROS TO SPOOLED-78
            CALL INTRINSIC "FFILEINFO" USING PRINTER-FILE,
                                           38, SPOOLED-38
                                           78, SPOOLED-78
            IF SPOOLED-38 = ZERO AND SPOOLED-78 = ZERO
            THEN
                    MOVE "N"       TO PRINTER-IS-SPOOLED-FLAG
                    MOVE ZERO      TO CCTL
            ELSE
                    MOVE "Y"       TO PRINTER-IS-SPOOLED-FLAG
                    PERFORM SETUP-SPOOLED-PRINTER
            END-IF
    ELSE
            MOVE ZERO TO FILE-ERROR
            CALL INTRINSIC "FCHECK" USING PRINTER-FILE FILE-ERROR
            IF FILE-ERROR = 55
            THEN
                   complain to user that someone is using the device
            END-IF
    END-IF

The FFILEINFO 78 is used when the spool file number is greater than 32,766.
 The file equate as Scott and Stan explained is still required to specify the
device, output class and number of copies.


Chuck Duncan

ATOM RSS1 RSS2