Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Bluer Absent Member.
Absent Member.
3367 views

Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution

Hi,

 

I would like to print a pdf file using the new enhancement of ACUCOBOL-GT. In the documentation, it mentioned "

In the documentation, it mentioned, "Use the -P PDF filename syntax in your runtime configuration file to write output to a PDF file named filename". 

Where can I find the runtime configuration file? And how exactly can I get it to generate pdf file?

 

Any help I can get is very appreciated. Thanks!

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
Here is a link to the documentation about the runtime configuration file and variables - http://bit.ly/2rnejlo

Here is a very simple program that creates a PDF file - http://simp.ly/p/rwLK5R
---
Martin Turner
Product Support Engineer
Micro Focus

View solution in original post

18 Replies
Micro Focus Expert
Micro Focus Expert

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
Here is a link to the documentation about the runtime configuration file and variables - http://bit.ly/2rnejlo

Here is a very simple program that creates a PDF file - http://simp.ly/p/rwLK5R
---
Martin Turner
Product Support Engineer
Micro Focus

View solution in original post

Bluer Absent Member.
Absent Member.

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
Thanks!! I'll try it out and let you know the result.
0 Likes
Bluer Absent Member.
Absent Member.

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
Hi MTurner,

I tried to run your program on my HP-UX server but it is unable to produce any pdf file. Nothing happened after running the program. Do you know the cause?

Below is the program I wrote based on the one you provide but it still cannot produce pdf file.

IDENTIFICATION DIVISION.
PROGRAM-ID. printpdf.

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.

INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT PRINT-FILE
ASSIGN TO "-P PDF report.pdf"
FILE STATUS IS PRINT-STATUS.

DATA DIVISION.
FILE SECTION.
FD PRINT-FILE.
01 PRINT-REC PIC X(300).

WORKING-STORAGE SECTION.
77 PRINT-STATUS PIC X(02).
01 PRINT-TEST PIC X(10) VALUE 'print test'.

********************************************************************
PROCEDURE DIVISION.

DECLARATIVES.

END DECLARATIVES.

********************************************************************
MAIN-LOGIC.

OPEN OUTPUT PRINT-FILE.
WRITE PRINT-REC FROM PRINT-TEST.
CLOSE PRINT-FILE.

STOP RUN.
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
I ran your program here and it works fine so that's not the issue. It's possible that you don't have the correct permissions so the PDF can't be written to the directory.
---
Martin Turner
Product Support Engineer
Micro Focus
0 Likes
corne_broers
New Member.

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
I also tried this program on a Linux-server and I get a file-error 30:
*==========================================+
| |
| File error 30,32 on PDF /tmp/PRINT.PDF |
| COBOL error at 00002B in TESTPDF |
| |
| <Ok> |
| |
+------------------------------------------+
TESTPDF.new: size: 560 (230), v10.0, RM-mode, tables checked, debug (08-Jun-201
7 12:50:13)
ccbl -o ../object/TESTPDF.new -e /WERK/list/TESTPDF.new -Cr -C51 -Zr1 -Ds -V
q -Za -Tf 6 -Te 200 -Gd -Sp /ontw/versnew/ritsel/source:/ontw/versnew
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
Are you using 10.1 runtime?
---
Martin Turner
Product Support Engineer
Micro Focus
0 Likes
corne_broers
New Member.

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
yes
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
30/32 for Linux is a broken pipe error. Have you tried the example Martin sent, compile and execute it in the acu bin directory? I tried all of your compile options on a Linux server with 10.1 and I was able to get the pdf created.
0 Likes
Snyders Absent Member.
Absent Member.

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
The program works fine now. Thank you so much for your help. Do you happen to know how to produce the output in a specific path?
0 Likes
corne_broers
New Member.

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution

I put the testprogram in the acu/bin directory. Still not working. I started the program in debug-mode. The open-file gives an error that a bin/sh command is not found.

           ASSIGN TO PRINT ws-printer                                      

           ORGANIZATION IS LINE SEQUENTIAL                                

           FILE STATUS IS PRINT-STATUS.                                    

       data division.                                                      

       file section.                                                      

       FD print-file.                                                      

       01 print-rec                 pic x(200).                            

       working-storage section.                                            

       01 WS-PRINTER           PIC X(51) VALUE spaces.                    

       01 PRINT-STATUS         PIC X(02).                                  

       procedure division.                                                

       DECLARATIVES.                                                      

       END DECLARATIVES.                                                  

       main-logic.                                                        

           move "-p pdf PRINT.PDF" to ws-printer                          

           open output print-file                                          

@           move "Test Print" to print-rec                                  

           write print-rec                                                

           close print-file                                                

           stop run.                                                      

<<EOF>>                                                                    

------------------------- Micro Focus extend Debugger ----------------------

Running all threads                                                        

TESTPDF 000005: S                                                          

TESTPDF 00000D: S                                                          

TESTPDF 000018: /bin/sh: pdf: command not found                            

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
Are you using a shared library runtime? If so, can you confirm that LD_LIBRARY_PATH is pointing to the 10.1 lib directory.
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
You should be able to use a specific path as long as permissions are correct. I was just trying to see if permissions on the /tmp directory were what was causing the issue.
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
I did a web search and found this: you may be missing a symbolic link from /bin to /usr/bin. Can you try ln -s /usr/bin /bin
and see if the error still occurs
0 Likes
aw_muench Respected Contributor.
Respected Contributor.

RE: Generating PDF file using new ACUCOBOL-GT enhancement

Jump to solution
Sorry to jump into your conversation but the error says there is no command "pdf" in /bin/sh and to my knowledge this is correct. Another idea: is the extension case-sensitive ?
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.