×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NetCobol 7.3.2: How to specify printer format for ReportWriter report

NetCobol 7.3.2: How to specify printer format for ReportWriter report

NetCobol 7.3.2: How to specify printer format for ReportWriter report

(OP)
I am forced to use an older, unsupported version of NetCobol (7.3.2) for a straight conversion of numerous existing cobol programs from VMS to Linux environment.  The Cobol programs use ReportWriter to create reports that are printed to various printers.  The formatting of the reports (e.g., font, page orientation) is handled externally to the cobol program, i.e, the cobol program generates a simple ascii file and the VMS print command specifies a FORM that sends the appropriate PCL to the appropriate printer.

Using NetCobol as installed, the ReportWriter reports are being generated in Postscript which does not have the proper formatting and when sent to the printer with the PCL commands does not print correctly.

I am trying to find a specification for the Printer Information File (prtinf) in order to change the output format of reports generated with the ReportWriter feature.  The reports need to be generated as simple ascii text files and use the existing PCL to be formatted.  

I found the prtinf.eng file in /opt/FJSVcbl/COBOLRT/config/cob-defaults which set printer attribute to PS1 (see below).  If I remove this value, the reports appear to be generated with PCL which I believe is specific to EPSON printers.  I need to generate simple ascii text (I can handle the conversion of any end of line characters CR/LF) but I don't know what value to use to accomplish this.  NOTE:  I also looked into converting the Postscript to ASCII using ps2ascii but the ReportWriter generated postscript report has character spacing which results in a space between every character in the ASCII version.

The only reference I can find related to this subject is in the NetCOBOL PowerFORM Runtime Reference Manual (V10).  Appendix C provides a definition of the Printer Information File but the keywords (e.g., PRTDRV) do not match the keywords found in the installed file (printer) and adding the keywords results in a runtime error.  


# cat /opt/FJSVcbl/COBOLRT/config/cob-defaults/prtinf.eng
#---------------------------------------------------------------#
# Default print information file (ENGLISH)                      #
#---------------------------------------------------------------#
papersize   ltr
printer     PS1
 

RE: NetCobol 7.3.2: How to specify printer format for ReportWriter report

I dont know anything about Netcobol, but PCL is a standard laser printer control which should work on any laser printer.

RE: NetCobol 7.3.2: How to specify printer format for ReportWriter report

(OP)
mrregan, thanks for the response.  

I'm not a printer expert but I have learned that there are several different Printer Control Languages.  PCL generally refers to the common HP PCL language for LaserJet printers.  However, there are others such as EPSON sometimes referred to as ESC/P.

My problem is that there is a directive in the NetCobol prtinf file (printer  PS1) which is controlling which format is output from using the ReportWriter feature of COBOL and I cannot find any documentation of what values are supported.   Using PS1 generates PostScript.  Remove the value generates EPSON ESC/P control codes.   I want simple ASCII but could probably accommodate HP PCL if i could just find out how to configure this in NetCOBOL.    

RE: NetCobol 7.3.2: How to specify printer format for ReportWriter report

you might be able to keep the output as postscript and then use one of the postscripts to pcl converters. ghostscript for example.

Depending on your linux distro you may even have it already installed on your os, or it may be available as a package.

most of the times they are very easy to use, and you can use it as a pipe on your lp command or just run them on a ps file to convert to a pcl.

have a go at it. lots of info available on the net

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: NetCobol 7.3.2: How to specify printer format for ReportWriter report

(OP)
fredericofonseca, good idea about converting from postscript.  I did try this but the postscript file uses a strange font and character spacing and when i used the ghostscript ps2ascii program the ascii text has a space between every letter attempting to duplicate the spacing.  

There appears to be NO formatting in the cobol program itself which uses Report Writer.  A portion of the REPORT SECTION is shown below.  So I'm looking for how to configure the printer information file.  In addition to the value PS1 for Postscript printer, i have also found an example of the value UVPI which appears to generate EPSON specific PCL.  I cannot find any other valid values for printer.  And I cannot find how to change the font and/or spacing to generate simpler Postscript which could be converted.


 REPORT SECTION.
 RD  PROJ-SUMMARY-REPORT
     CONTROLS ARE FINAL, SL-TYPE, SL-DEPT
     PAGE LIMIT 61
     HEADING    1
     FIRST DETAIL 9
     LAST  DETAIL 58
     FOOTING  59.
 01  TYPE PAGE HEADING.
     03 LINE 1.
        05 COLUMN  3            PIC  X(5)  VALUE "DATE:".
         05 COLUMN  9           PIC  Z9    SOURCE SYS-MM.
        05 COLUMN 11            PIC  X     VALUE "/".
         05 COLUMN 12           PIC  99    SOURCE SYS-DD.
        05 COLUMN 14  PIC  X     VALUE "/".
         05 COLUMN 15           PIC  99    SOURCE SYS-YY.
         05 COLUMN 53           PIC  X(29)      VALUE
                "COMPANY NAME HERE".
         05 COLUMN 110  PIC  XXXX  VALUE "PAGE".
         05 COLUMN 115  PIC  Z(5)  SOURCE PAGE-COUNTER.
     03 LINE 3.
         05 COLUMN  1  PIC  X(33)       VALUE
            "PROJECT MANAGEMENT SUMMARY REPORT".
     03 LINE 4.
        05 COLUMN  1  PIC  X(15) VALUE
           "MONTH ENDING - ".
        05 COLUMN 16  PIC  X(11) SOURCE TH-DATE.
  

RE: NetCobol 7.3.2: How to specify printer format for ReportWriter report

did you try ps2pcl?

and just to be sure are you using any keyword specific to powerFORM or just standard reportwriter ones?

and if not using powerFORM would that be a option to change programs?

Just looking at alternatives here. I don't have the 7.3 manual but have all other manuals from v3 to v8 + v10 ones and can't find, so far, any reference to those switches either.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: NetCobol 7.3.2: How to specify printer format for ReportWriter report

I used SQR language (long time ago) to print forms, checks,micr etc using PCL and or postcript. PCL 6 should handle all lower version. You have to be familiar with the many PCL commands in order to accomplish this. Any laserjet/Epson printer is able to interpret PCL/Postcripts commands. You can use plain notepad to do this and I believe Cobol should be able to do it too (although I never tried it) as long as you can find a way to create a non-displayed set of characters which is interpreted by the printer as a command. I don't have my PCL manuals anymore but if you can tell me what PCL commands you need, maybe I can search my libraries for the codes.

here's a short example that I can remember
ENCODE '<27>&l2S' into $printf   <<< Landscape mode, short edge
ENCODE '<27>&l1S' into $printf  << Portrait, long edge
ENCODE '<27>&l0S' into $printf  << Portrait, short edge
PRINT $printf (1,1)    << encode in row 1, col 1

Where ENCODE creates the non-displayed commands,
PRINT embed the commands in the file.

On a typical print functions a combination of command are sometime necessary to initialize a printer. Here's one of it.

printer-init <27>E<27>&l0L<27>&l3A
             |     !--> Perforation Skip
             --> Reset

On the print file itself you can see these hidden commands by using some kind of text editor like ultraedit.
 

RE: NetCobol 7.3.2: How to specify printer format for ReportWriter report

Not sure if this will help, but in the CBR file do you have the @PrinterFontName setup? @PrinterFontName=(Courier New,Courier New) or something similar.  Here is what I can find in the samples for NetCobol.

002540 FD  PRINT-FILE.
002550 01  LINE-REC             PIC X(136).
002560 01  CMNT-REC             PIC X(050).
002570 01  CNTL-REC             PIC X(100).

004840* DATA FOR I-CONTROL-RECORD
004850 01  I-CNTL-DATA.
004860   02  REC-ID             PIC X(002) VALUE "I1".
004870   02  REC-MODE           PIC X(001) VALUE "1".
004880   02  FOVL.
004890     03  FOVL-NAME        PIC X(004) VALUE SPACE.
004900     03  FOVL-R           PIC 9(003) VALUE 0.
004910   02  PAGE-COPY          PIC 9(003) VALUE 0.
004920   02  FCB-NAME           PIC X(004) VALUE SPACE.
004930   02  FORMAT-ID          PIC X(008) VALUE SPACE.
004940   02                     PIC X(030) VALUE SPACE.
004950   02  PAGE-FORM          PIC X(002) VALUE SPACE.
004960   02  PAPER-SIZE         PIC X(003) VALUE SPACE.
004970   02                     PIC X(004) VALUE SPACE.
004980   02  PRINT-DUPLEX       PIC X(001) VALUE SPACE.
004990   02  PRINT-POSITION     PIC X(001) VALUE SPACE.
005000   02  NON-PRINT-AREA     PIC X(001) VALUE SPACE.
005010   02  BIND-DIRECTION.
005020     03  PORT-FRONT       PIC X(001) VALUE SPACE.
005030     03  PORT-BACK        PIC X(001) VALUE SPACE.
005040     03  LAND-FRONT       PIC X(001) VALUE SPACE.
005050     03  LAND-BACK        PIC X(001) VALUE SPACE.
005060   02  BIND-WIDTH           PIC X(004) VALUE SPACE.
005070   02  PRINT-OFFSET.
005080     03  FRONT-X          PIC X(004) VALUE SPACE.
005090     03  FRONT-Y          PIC X(004) VALUE SPACE.
005100     03  BACK-X           PIC X(004) VALUE SPACE.
005110     03  BACK-Y           PIC X(004) VALUE SPACE.
005120   02  DOCUMENT-NAME      PIC X(004) VALUE SPACE.
005130   02  FILLER             PIC X(005) VALUE SPACE.

005310* FOR 6LPI
005320*
005330* SET TO I-CONTROL-RECORD DATA
005340     MOVE "LT6L" TO FOVL-NAME.
005350     MOVE 1      TO FOVL-R.
005360     MOVE 1      TO PAGE-COPY.
005370     MOVE "LT6L" TO FCB-NAME.
005380     MOVE "L"    TO PAGE-FORM.
005390     MOVE "LTR"  TO PAPER-SIZE.
005400     MOVE "F"    TO PRINT-DUPLEX.
005410     MOVE "F"    TO PRINT-POSITION.
005420     MOVE "DOC1" TO DOCUMENT-NAME.
005430* WRITE I-CONTROL-RECORD
005440     WRITE CNTL-REC FROM I-CNTL-DATA
005450                        AFTER ADVANCING PAGE-CNTL.

PAGE-CNTL IS IN SPECIAL-NAMES (CTL IS PAGE-CNTL)

RE: NetCobol 7.3.2: How to specify printer format for ReportWriter report

(OP)
Found a solution:  Use ORGANIZATION LINE SEQUENTIAL in your FILE-CONTROL SELECT statements. This will remove the postscript characters.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close