we handle “classic” print-output, created in batch, on our hp-ux in the following way:
we use the “well known” natural “dd-Names” for reports (e.g. cmprt01, cmprt02 …), as
we did it on the ibm mainframe. advantage: nothing changed in the programs.
within the batch-script linked to the “dd-Name” is a (temporary) file. This is done by
a shell-command, using an environment-variable, like this:
export CMPRT01=/tmp/cmprt01_"$stepname"_$$.txt # Report-No 01 goes here ...
- start natural in “real batch mode”. output from write-statements are going directly to the
tempP='CMPRT01=$CMPRT01 CMPRT02=$CMPRT02 CMPRT03=$CMPRT03'
tempS='CMPRINT=$CMPRINT CMSYNIN=$CMSYNIN CMOBJIN=$CMOBJIN'
natural batchmode PARM=NATINT $tempS $tempP
This is a code-snippet out of a typical batch-script: start the program log1ipth from
library LOG-DPH and send the reports to the archiving-system:
. create_natsynin "LOGON LOG-DPH" "acommon" "log1ipth"
. syslog $cmsynin
. allocnatural "$dvsystem" "$procname" 'st010'
cat $cmprint > "$JobFolder"/st010-cmprint.txt
. printprot "$JobFolder"/st010-cmprint.txt 'SYSOUT'
. checkreturncode $?
. archiveprint $cmprt01 'W,L1803010,ploh0'
. archiveprint $cmprt02 'W,L1803020,ploh0'
. archiveprint $cmprt03 'W,L1803030,ploh0'
- after natural has terminated, the file(s) can be send to a “real” printer (using the unix-print-subsystem) and/or
send to an archiving system and/or send to the user(s) by e-mail. all this stuff is done on script-level.
4a) printing is done by the lp-command. printer-specific headers and trailers are inserted via user-exits
(e.g. for kyocera, hp and so on)
4b) archiving: sending the print-file to an archiving-system (.archiveprint)
4c) conversion to rtf: Insert a header for portrait-/landscape-format, depending on the line-size of the report, and
extend the file-content by some rtf-specific requirements. in windows-world this make the content of the file printer-independent.
Reports from automated batch-jobs normaly going to our archiving-system.
Report from Batch-jobs started by the end-user can be printed and/or send by e-mail. The user has the choice to select the
desired printer by name.
much more flexible than to create a “classic” output is to create a xml-file and do the formatting by xslt and/or jscript (Ajax).
we create reports in xml-format from natural and show the result directly in a web-browser, convert it to Excel
(via HSSF, even on unix) or to pdf (xsl-fo).
let me know if you like to get more information.