Highlighted
Regular Contributor.
Regular Contributor.
248 views

Having an issue creating pdf Files when program called from internet APEX Interface

Extend 10.2 - when executed from a command prompt on server - all is well the following code is executed and file is created and pdf viewer displays output.

This program is reading oracle tables

 

       306-PDF-CALL.
           MOVE SPACES TO WS-PDF-TEXT-FILENAME, WS-PDF-FILENAME,
                          WS-PDF-CALL, WS-START-PDF-FILENAME.


           MOVE WS-CALL-FILE TO WS-PDF-TEXT-FILENAME, WS-PDF-FILENAME.
           INSPECT WS-PDF-TEXT-FILENAME
             REPLACING TRAILING SPACES BY "!".             
         

           PERFORM VARYING C-IDX FROM 1 BY 1 UNTIL C-IDX > 20
              IF WS-PDF-FILENAME-R(C-IDX) NOT EQUAL SPACES
                 MOVE C-IDX TO C-IDX
              ELSE
                 MOVE ".PDF" TO WS-PDF-FILENAME(C-IDX:4)
                 EXIT PERFORM
              END-IF
           END-PERFORM.
 

           INSPECT WS-PDF-FILENAME
             REPLACING TRAILING SPACES BY "!".

 


           MOVE "PDFV.EXE" TO LIST-PATTERN.

           CALL "C$LIST-DIRECTORY"
                 USING LISTDIR-OPEN, WS-PDF-EXE-DIR-NAME, LIST-PATTERN
           END-CALL.

           MOVE RETURN-CODE TO LIST-MYDIR.

      *****if list-mydir = zero then the PDFV.EXE was not found in the
      *****directory one level up (should be the case when run here at
      *****KVS), so it will look in the working directory for it.
           IF LIST-MYDIR = ZERO
              STRING "PDFV.EXE"        DELIMITED BY SIZE
                     " "                  DELIMITED BY SIZE
                     WS-PDF-PARM-LINE     DELIMITED BY "!"
                     " "                  DELIMITED BY SIZE
                     WS-PDF-TEXT-FILENAME DELIMITED BY "!"
                     " "                  DELIMITED BY SIZE
                     ">"                  DELIMITED BY SIZE
                     "PDF_FILES"          DELIMITED BY SIZE
                     "\"
                     WS-PDF-FILENAME      DELIMITED BY "!"                                  
                INTO  WS-PDF-CALL
              END-STRING
           ELSE
              STRING "..\ICOBOL\PDFV.EXE"        DELIMITED BY SIZE
                     " "                  DELIMITED BY SIZE
                     WS-PDF-PARM-LINE     DELIMITED BY "!"
                    " "                  DELIMITED BY SIZE
                     WS-PDF-TEXT-FILENAME DELIMITED BY "!"
                     " "                  DELIMITED BY SIZE
                     ">"                  DELIMITED BY SIZE
                     "PDF_FILES"          DELIMITED BY SIZE
                     "\"
                     WS-PDF-FILENAME      DELIMITED BY "!"                                  
                INTO  WS-PDF-CALL
              END-STRING
           END-IF.

           CALL "C$LIST-DIRECTORY"
                 USING LISTDIR-CLOSE, LIST-MYDIR
           END-CALL.

           MOVE SPACES TO LIST-PATTERN.                          

           CALL "C$SYSTEM" USING WS-PDF-CALL, 96
                 GIVING CALL-RESULT.

           INSPECT WS-PDF-FILENAME
             REPLACING TRAILING "!" BY SPACES.

           MOVE WS-PDF-FILENAME TO WS-START-PDF-FILENAME.
           CALL "C$SYSTEM" USING WS-START-PDF, 96
                GIVING CALL-RESULT.           
 
           CALL "C$DELETE" USING WS-PDF-FILENAME
              GIVING DELETE-STATUS.

       306-EXIT.
           EXIT.

Highlighted code seems to be the issue.

WS-PDF-CALL = "..\ICOBOL\PDFV.EXE -fCourier-Bold -L -l66 -v8 -s9 -c500 PRQANNIV.310 > PDF_FILES\PRQANNIV.310.PDF

In APEX Interface situation PRQANNIV.310.PDF file is created in appropiate directory however, the size is 0 and the process hangs up.

I set up a trace log however, the trace stops at the first i-o command access an oracle table.

 

 

 

 

 

 

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Having an issue creating pdf Files when program called from internet APEX Interface

Does the "..\ICOBOL\PDFV.EXE -fCourier-Bold -L -l66 -v8 -s9 -c500 PRQANNIV.310 > PDF_FILES\PRQANNIV.310.PDF run correctly when run as a bat file?

0 Likes
Highlighted
Regular Contributor.
Regular Contributor.

Re: Having an issue creating pdf Files when program called from internet APEX Interface

Yes,

The file is created as a .bat file and when the larger process is called using a .bat file from the cmd prompt on the server the pdf file is created.

 

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.