GETMAIN + SPOOLOPEN



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

GETMAIN + SPOOLOPEN

Postby acpascal » Tue Oct 21, 2014 7:10 pm

Hello
I contact you because I have sometimes a problem in a CICS COBOL program when I do a GETMAIN and a SPOOLOPEN.
The following error occurs on the insctruction SPOOLOPEN : "16 44 ERROR IN THE OUTDESCR STRING".
When I meet this error, I have the problem between 15 and 45 minutes ; after, the error disappears without my intervention and the program execution is OK.
I join you an extract of the program code.
I'd be very happy and eased if someone could help me to solve this problem.
Thanks in advance for your help
Regards
Pascal

       01 F.                                                                   
         02 W-POINTER USAGE POINTER.                                           
         02 W-POINTER1 REDEFINES W-POINTER PIC 9(9) COMP.                       
       01  APPL-ID.                                                             
           03  FILLER                   PIC X(04).                             
           03  ENV                       PIC X.                                 
           03  FILLER                   PIC X(03).                             
         *                   L I N K A G E   S E C T I O N                *       
       LINKAGE  SECTION.                                                       
       01  DFHCOMMAREA.                                                         
         03  ZCOM.                                                             
            05 CD-FONC                  PIC X(3).                               
            05 CD-RET                   PIC 9(2).                               
            05 EDT-NAME                 PIC X(8).                               
            05 EDT-ID                   PIC X(8).                               
            05 EDT-DEST-ID              PIC X(8).                               
            05 EDT-USER                 PIC X(8).                               
            05 EDT-LGLIG                PIC 9(4) COMP.                         
            05 EDT-LIGNE                PIC X(4096).                           
            05 CD-RESP2                 PIC 9(9) COMP.                         
            05 DET-ERR                  PIC X(36).                             
            05 CD-ETA                   PIC X(15).                             
        01 L-FILLER.                                                             
        02 L-ADDRESS PIC 9(9) COMP.                                             
        02 L-OUTDIS PIC X(1020).         
                                       
         STRING EDT-NAME DELIMITED BY SPACE                               
                  ')'   DELIMITED BY SIZE           
                              INTO ETAT-NAME.                                     
         EXEC CICS GETMAIN SET(W-POINTER) FLENGTH(1024)                       
                  INITIMG(' ') END-EXEC.                                       
         SET ADDRESS OF L-FILLER TO W-POINTER.                               
         MOVE W-POINTER1 TO L-ADDRESS.                                       
         ADD 4 TO L-ADDRESS.                                                 
         STRING W-OUTDIS DELIMITED BY SIZE                                   
                  ' DEPT(' DELIMITED BY SIZE                                   
                  EDT-USER DELIMITED BY SPACE                                   
                  ') TITLE(' DELIMITED BY SIZE                                 
                  CD-ETA DELIMITED BY SPACE                                     
                  ')' DELIMITED BY SIZE                                         
                  INTO L-OUTDIS.                                               
           MOVE 'SPOOLOPEN' TO SPOOLFNC.                                       
           IF EDT-LGLIG = 0                                                     
               MOVE 4096 TO EDT-LGLIG                                             
           END-IF.                                       
           EXEC CICS SPOOLOPEN OUTPUT                                         
                   NOHANDLE                                                     
                   TOKEN(EDT-ID)  USERID('*')                                   
                   NODE('*')                                                   
                   OUTDESCR(W-POINTER)                                         
                   CLASS('7')                                                   
                   RECORDLENGTH(EDT-LGLIG)                                     
                   PRINT                                                       
             END-EXEC


Code'd
acpascal
 
Posts: 2
Joined: Tue Oct 21, 2014 3:52 pm
Has thanked: 1 time
Been thanked: 0 time

Re: GETMAIN + SPOOLOPEN

Postby BillyBoyo » Tue Oct 21, 2014 8:59 pm

When you have COMP PIC 9(9) the field has a maximum value of 999.999.999. This will not always work for the REDEFINES of a POINTER, which is an address, and which can be greater than that decimal value.

If you have a binary field of fixed-length (a field whose length you are unable to change), and you need more digits than the decimal number represented by the PICture, then define the field as COMP-5., not COMP. COMP-5 allows the use of all bits in the field, not limiting the value to the PICture description.

COMP PIC 9(4) maximum value 9999.
COMP-5 PIC 9(4) maximum value (2^16)-1.

These users thanked the author BillyBoyo for the post:
acpascal (Tue Oct 21, 2014 9:09 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: GETMAIN + SPOOLOPEN

Postby acpascal » Tue Oct 21, 2014 9:11 pm

Thank you Billy for your post
I'm going to apply it and give you some news a few days later
Regards
Pascal
acpascal
 
Posts: 2
Joined: Tue Oct 21, 2014 3:52 pm
Has thanked: 1 time
Been thanked: 0 time


Return to IBM Cobol