Creating professional PDF documents from basic Spool Files
Creating professional PDF documents from basic Spool Files, utilising report definitions, maps and dynamic use of images. (CVTSPLDBF & CVTSPLPDF)
Scenario: Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) � There is a Vehicle Stock Report and a professional document is required.
Scenario: Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) � From the Vehicle Stock Report you want to create a. PDF document as below: -
Scenario: Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) � The PDF document is to be produced, with the following : � Company logo at the top of each page. � Footer showing Car Make and Page Number. � Bookmarks for quick access to each Make of Car. � Distinctive Column Headings. � Each different Make of Car on a separate page with it’s own badge. � Spooled Data in a new font. � Overall professional PDF document to publish.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) The creation of the. PDF document, is carried out in stages. A i. Series Spooled File CVTSPLDBF Pages Nos. & Car Makes B Report Map A Report Map B Loop through d. B file ‘A’ to create a dynamic INCLFILE parameter for the CVTSPLPDF command. i. Series Spooled File Car Makes Page Nos. Report Fields CVTSPLDBF Create a basic version of the spool file, stripping out the headers. CVTSPLPDF A Pages Nos. & Car Makes B Car Makes Page Nos. Report Fields CVTSPLPDF CVTSPLDBF The file (B), (A), is created used to create extract earlier, isis earlier Car completed read used the Summarised Makes, record to create Page by a Pagedocument. Numbers record, new PDF basic Numbers and spool It and with Report dynamically file, uses Car a logo Fields. Makes no with fromextracted The building header headings, thethe i. Series spool Spool data INCLFILE information file data, is. File used pre– and latera Vehicle to parameter. footer defined define containing Stock Car the. This Make Report. bookmarks is the images used Car to and Make. Thefor a extracted each establish This. TTF spool Font Car which Make. data for file the isis Car Make used report todata. with establish logo the. The is what to CVTSPLPDF command be Car printed Make alsoat logos the command uses top the are of. Car to at each be the displayed page. end Make oftothe provide at the top of each page. process. Bookmarks. Press any key.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. A report definition will be created, @ABC_RPT. � To Create the Report Definition, either WRKRPTDFN is used, then F 6, or CRTRPTDFN.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � WRKRPTDFN is used to define the content of the report definitions @ABC_RPT. � The report ABC_STOCK has to have run and the spool file be available. Select the report definition to design by entering ‘ 11’ next to the report definition. � Locate the Spooled file you are defining (ABC_STOCK), and select it.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � When the spool file has been located, select it by taking option ‘ 1’. � The report definition can now be created.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � Once the Spooled File (ABC_STOCK) has been selected, lines, sections and items can be defined. � To extract the Page Number, a line has to be defined.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � To define the first line for the Page Numbers, within this report definition (@ABC_RPT), the cursor is positioned on the title line (line 1) and F 10 is pressed. � The Line name is set to PAGELINE 1. � F 9 is pressed to save the Report Line.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � When you have saved PAGELINE 1, the report definition will be updated. PAGELINE 1 will be highlighted in pink.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � To define the second line for the Car Makes, within this report definition (@ABC_RPT), the cursor is positioned on the line 3 and F 10 is pressed. � The Line name is set to CARMAKE 1. � F 9 is pressed to save the Report Line.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � When CARMAKE 1 has been saved, the report definition will be updated. � CARMAKE 1 will be highlighted in pink. � Now that the lines have been defined, a section needs to be created for the two lines.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � To create the section, the cursor is positioned on Line 1 and F 11 is pressed. � The section is named S_PAGEMAKE. � Start Line is PAGELINE 1, End Line is CARMAKE 1. � Included Lines are PAGELINE 1, CARMAKE 1. � F 9 is pressed to save the section.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � To get the Page Number from the report line, a report item has to be defined. � F 15 is used, from the Report Definition screen, to Work with Lines. � To add the Page Number item, PAGELINE 1 is selected and option 9 is entered.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � F 6 is used to add the new Report item. � An item name is specified along with the line and section. � The character position and length is specified to extract the page number.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � To get the Car Make from the report line, a report item has to be defined. � F 15 is used, from the Report Definition screen, to Work with Lines. � To add the Car Make item, CARMAKE 1 is selected and option 9 is entered.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � F 6 is used to add a new Report item. � An item name is specified along with the line and section. � The character position and length is specified to extract the car make.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � Now the report definition @ABC_RPT has been defined, a map has to defined, for use with the CVTSPLDBF command. � To create the map, WRKRPTDBF is used. � F 6 creates a map. � When enter is pressed, Report Items are assigned.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � (1) PAGENO 1 and (2) CARMAKE 1, are selected to be included in the map. � The first Spool file Database map has been created.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. � CVTSPLDBF is then used to create a summary of Page Numbers and Car Makes. � The resulting database file created will look as follows.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � A report definition will be created, @ABC_RPT 2. � To Create the Report Definition, either WRKRPTDFN is used, then F 6, or CRTRPTDFN.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � WRKRPTDFN is used to define the content of the report definitions @ABC_RPT 2. � The report ABC_STOCK has to have run and the spool file be available. Select the report definition to design by entering ‘ 11’ next to the report definition. � Locate the Spooled file you are defining (ABC_STOCK), and select it.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � When the spool file has been located, it is selected by taking option ‘ 1’. � The report definition can now be created.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � Once the Spooled File (ABC_STOCK) has been selected, the lines, sections and items can be defined. � To extract the Page Number, a line has to be defined.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � To define the first line for the Page Numbers, within this report definition (@ABC_RPT 2), the cursor is positioned on the title line (line 1) and F 10 is pressed. � The Line name is set to PAGELINE 2. � F 9 is pressed to save the Report Line.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � When you have saved PAGELINE 2, the report definition will be updated. PAGELINE 2 will be highlighted in pink.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � To define the second line for the Car Makes, within this report definition (@ABC_RPT 2), position the cursor on the title line (line 1) and press F 10. � The Line name is set to CARMAKE 2. � F 9 is pressed to save the Report Line.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � When CARMAKE 2 has been saved, the report definition will be updated. � CARMAKE 2 will be highlighted in pink.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � To define third line for the detail, within this report definition (@ABC_RPT 2), the cursor is positioned on line 7 and F 10 is pressed. � The Line name is set to DETAIL 2. � F 9 is pressed to save the Report Line.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � When DETAIL 2 has been saved, the report definition will be updated. � DETAIL 2 will be highlighted in pink. � Now that the lines have been defined, a section needs to be created for the three lines.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � To create the section, the cursor is positioned on Line 1 and F 11 is pressed. � The section is named S_PMD. � Start Line is PAGELINE 2, End Line is DETAIL 2. � Included Lines are CARMAKE 2, DETAIL 2 and PAGELINE 2. � F 9 is pressed to save the section.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � To get the Page Number from the report line, a report item has to be defined. � F 15 is used, from the Report Definition screen, to Work with Lines. � To add the Page Number item, PAGELINE 2 is selected by entering option 9.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � F 6 is used to add a new Report item. � An item name is specified along with the line and section. � The character position and length is specified to extract the page number.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � To get the Car Make from the report line, a report item is defined. � F 15 is used, from the Report Definition screen, to Work with Lines. � The Car Make item is added, by selecting CARMAKE 2 and entering option 9.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � F 6 is used to add a new Report item. � An item name is specified along with the line and section. � The character position and length is specified to extract the car make.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � To get the report fields from the report line, report items have to be defined. � F 15 is used, from the Report Definition screen, to Work with Lines. � To add the Report Fields, DETAIL 2 is selected by entering option 9.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � F 6 is used to add a new Report item. � An item name for the MODEL@ is specified along with the line and section. � The character position and length is specified to extract the Model.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � F 6 is used to add a new Report items for the following. Report Item Character Pos. Character Len. MILEAGE@ 18 7 FUELTYPE@ 33 10 ENGINESZ@ 48 6 COLOUR@ 64 15 REGIST@ 80 10
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � Now the report definition @ABC_RPT 2 has been defined, a map has to defined, for use with the CVTSPLDBF command. � To create the map, WRKRPTDBF is used. � F 6 will create the map. � When enter is pressed, Report Items are assigned.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � Select (1) PAGENO 2 (3) MODEL@ (5) FUELTYPE@ (7) COLOUR@ � These fields will be included in the map. (2) CARMAKE 2 (4) @MILEAGE (6) ENGINESZ@ (8) REGIST@ � The second Spool file Database map has been created.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. � CVTSPLDBF is then used to create a database file of Page Numbers, Car Makes and Report fields. � The resulting database file created will look as follows.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Dynamically build the INCLFILE parameter. � Within the controlling CL program, a variable is used to store the CVTSPLPDF command. � At this stage, the contents of the command contains the following. CVTSPLPDF FROMFILE(ABC_STOCK 2) SPLNBR(*LAST) STMFOPT(*REPLACE) EMAIL(*YES) EMAILTO((ABC@XYZ. COM)) BOOKMARK(*KEY) BMARKPOS((64 21 9)) BMARK KEY(('STOCK LIST FOR : ' * FIRSTPAGE 16 9)) CVTFONTID(((*CPI) ('/HOME/LORDG/TALL_LEAN. TTF' 18))) INCLFILE(('/HOME/LORDG/ABC_MOTORS. JPG' *JPG *EMBEDDED * ALL 170 28 *MM *NONE 1) ('/HOME/LORDG/ABC_MOTORS 2. JPG' *JPG *EMBEDDED *ALL 2 26 *MM *NONE 1)
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Dynamically build the INCLFILE parameter. � The following piece of code is required to dynamically add to the INCLFILE parameter. � Database file ‘A’ that was created earlier, is used to add a jpg to the parameter for each entry within the file. RCVF MONMSG CHGVAR GOTO ENDMAKE : MSGID(CPF 0864) EXEC(GOTO CMDLBL(END_MAKE)) VAR(&BADGE) VALUE(&MAKEOFCAR *TCAT &JPG) VAR(&PGN) VALUE(&PAGENO) VAR(&THECMD) VALUE(&THECMD *TCAT &SOB *TCAT + &SQ *TCAT &MAKE 1 *TCAT &BADGE *TCAT &SQ + *TCAT &MAKE 2 *TCAT &PAGENO *TCAT &SCB) CMDLBL(GET_MAKE)
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Create a basic spool file without the headers. � To enable the CVTSPLPDF command, to show the detail from the report and not the report headings, a new basic spool file required. � A print file is created (ABC_STOCK 2). R HDR 13 R DTLR MODEL@ MILEAGE@ FUELTYPE@ ENGINESZ@ COLOUR@ REGIST@ 15 7 10 6 15 10 1 ' ' 8 20 33 49 61 70 SPACEA(2) R PAGN CARMAKE 2 #PAGE 20 4 0 64 7'Stock List for : ' 64 22 64 74'Page : ' 64 80 EDTCDE(4)
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Create a basic spool file without the headers. � To create the basic spool file a simple RPG program is created. FABC_STOCK 2 O E FABC_STK 2 IF E D DS D c movel c read * * Check for change of page * c if c write c endif * c dow c write c movel c read PRINTER OFLIND(*IN 99) DISK rename(ABC_STK 2: @ABCSTCK 2) '9999' '****' abc_stk 2 PAGE_TEMP MAKE_TEMP 4 20 88 page_temp <> PAGENO 2 hdr *in 88 = '0' DTLR PAGENO 2 CARMAKE 2 abc_stk 2 page_temp make_temp 88
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Create a basic spool file without the headers. � RPG program continued. c read * * Check for change of page * c if c movel c write c endif * c enddo c movel c write * * Program End * C MOVE C RETURN abc_stk 2 88 page_temp <> PAGENO 2 page_temp #page make_temp carmake 2 pagn hdr page_temp pagn #page '1' *INLR
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Create a basic spool file without the headers. � The basic spool file is created as follows.
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Using CVTSPLPDF to create the PDF document. � Before the PDF document can be produced, the following needs to be placed on the i. Series within the Integrated File System (IFS). o o Tall and Lean True Type Font (TALL_LEAN. TTF), this can be downloaded from the internet. The header image showing the Company logo and column heading (ABC_MOTORS. JPG), needs copying to the IFS. The footer image showing a separator line and the bottom of the page (ABC_MOTORS 2. JPG), needs copying to the IFS. All Car Make Badge logos needs copying to the IFS. � The command will then be passed to the program QCMDEXC as follows. o CVTSPLPDF FROMFILE(ABC_ST OCK 2) SPLNBR(*LAST) STMFOPT(*REPLACE) EMAIL(*YES) EMAILTO((COOL@SPOOLS. COM)) BOOKMARK(*KEY) BMARKPOS((64 21 9)) BMARK KEY(('STOCK LIST FOR : ' * FIRSTPAGE 16 9)) CVTFONTID(((*CPI) ('/HOME/LORDG/T ALL_LEAN. TTF' 18))) INCLFILE. . (INCLFILE contains all the images)
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Using CVTSPLPDF to create the PDF document. � The complete CL program is as follows. PGM /* DECLARE FILE FOR READING IN PAGE NUMBERS AND MAKE OF CARS */ DCLF FILE(CS_GLLIB/ABC_STK) /* DECLARE &SP - SPACE */ DCL VAR(&SP) TYPE(*CHAR) LEN(1) VALUE(X'40') /* DECLARE &SQ - SINGLE QUOTE ' */ DCL VAR(&SQ) TYPE(*CHAR) LEN(1) VALUE(X'7 D') /* DECLARE &DCB - DOUBLE CLOSE BRACKET */ DCL VAR(&DCB) TYPE(*CHAR) LEN(2) VALUE('))') /* DECLARE &SCB - SINGLE CLOSE BRACKET */ DCL VAR(&SCB) TYPE(*CHAR) LEN(1) VALUE(')') /* DECLARE &SOB - SINGLE OPEN BRACKET */ DCL VAR(&SOB) TYPE(*CHAR) LEN(2) VALUE(' (') /* DECLARE &CMDL - PARAMETER NEED FOR THE QCMDEXC CALL */ DCL VAR(&CMDL) TYPE(*DEC) LEN(15 5) VALUE(6000) /* DECLARE &THECMD - PARAMETER USED TO PROCESS THE COMMAND */ DCL VAR(&THECMD) TYPE(*CHAR) LEN(6000) /* DECLARE &TITLE 1/2 - LOGO IMAGE AT THE TOP OF EACH PAGE */ DCL VAR(&TITLE 1) TYPE(*CHAR) LEN(100) + VALUE('/HOME/LORDG/ABC_MOTORS. JPG') DCL VAR(&TITLE 2) TYPE(*CHAR) LEN(100) VALUE(' + *JPG *EMBEDDED *ALL 170 28 *MM *NONE + *NONE 1') /* DECLARE &FOOTER 1/2 - LOGO IMAGE AT THE FOOT OF EACH PAGE */ DCL VAR(&FOOTER 1) TYPE(*CHAR) LEN(100) + VALUE('/HOME/LORDG/ABC_MOTORS 2. JPG') DCL VAR(&FOOTER 2) TYPE(*CHAR) LEN(100) VALUE(' + *JPG *EMBEDDED *ALL 2 26 *MM *NONE 1')
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Using CVTSPLPDF to create the PDF document. � The complete CL program continued. /* DECLARE &MAKE 1/2 - BASIS OF EACH IMAGE PATH */ DCL VAR(&MAKE 1) TYPE(*CHAR) LEN(100) + VALUE('/HOME/LORDG/') DCL VAR(&MAKE 2) TYPE(*CHAR) LEN(100) VALUE(' + *JPG *EMBEDDED *PAGNBR 170 3 *MM *NONE + *NONE. 5 *NONE *ABS *FIRST *KEEP ') /* DECLARE &INCLF - BASIS OF EACH INCLFILE PARAMETER, FOR THE IMAGES */ DCL VAR(&INCLF) TYPE(*CHAR) LEN(1024) DCL VAR(&PATH 1) TYPE(*CHAR) LEN(5000) VALUE(' + INCLFILE((') /* DECLARE &BADGE - THE NAME OF THE JPG FOR THE CAR MAKE IMAGE */ DCL VAR(&BADGE) TYPE(*CHAR) LEN(30) DCL VAR(&JPG) TYPE(*CHAR) LEN(4) VALUE('. JPG') /* DECLARE &PGN - THE PAGE NUMBER WHERE THE CAR MAKE IMAGES WILL APPEAR */ DCL VAR(&PGN) TYPE(*DEC) LEN(4 0) /* DECLARE &THECMD - QCMDEXC WILL BE USED WITH &THECMD TO PROCESS THE */ /* CVTSPLPDF COMMAND */ DCL VAR(&THECMD) TYPE(*CHAR) LEN(6000) /* /* /* SETUP THE CVTSPLPDF COMMAND */ 1. SPECIFY THE BASIC SPOOL FILE */ 2. SPECIFY THE EMAIL ADDRESS */ 3. USE THE REPORT FOOTER (CAR MAKE) FOR BOOKMARKS */ 4. USE THE TALL AND LEAN TRUE TYPE FONT FOR THE REPORT DETAIL */ CHGVAR VAR(&THECMD) VALUE('CVTSPLPDF + FROMFILE(ABC_STOCK 2) SPLNBR(*LAST) + STMFOPT(*REPLACE) EMAIL(*YES) + EMAILTO((GEOFF 543524@HOTMAIL. COM)) + BOOKMARK(*KEY) + BMARKPOS((64 21 9)) BMARKKEY((''STOCK + LIST FOR : '' *FIRSTPAGE 16 9)) + CVTFONTID(((*CPI) + (''/HOME/LORDG/TALL_LEAN. TTF'' 18)))')
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Using CVTSPLPDF to create the PDF document. � The complete CL program continued. /* ADD THE HEADER AND FOOTER IMAGES TO PATH 1. &PATH 1 WILL BE USED IN &THECMD */ CHGVAR VAR(&PATH 1) VALUE(&PATH 1 *TCAT &SQ *TCAT + &TITLE 1 *TCAT &SQ *TCAT &TITLE 2 *TCAT &SCB) CHGVAR VAR(&PATH 1) VALUE(&PATH 1 *BCAT &SOB *TCAT &SQ + *TCAT &FOOTER 1 *TCAT &SQ *TCAT &FOOTER 2 + *TCAT &SCB) /* ADD THE &PATH 1 TO &THECMD */ CHGVAR VAR(&THECMD) VALUE(&THECMD *TCAT &PATH 1) /* CREATE SPOOL FILE BEING USED TO CREATE THE PDF DOCUMENT */ CALL PGM(ABC_STKR 1) /* PAGES AND MAKES */ CVTSPLDBF FROMFILE(ABC_STOCK) SPLNBR(*LAST) + MAPNAME(ABC_DB_MAP 1) + TOFILE(CS_GLLIB/ABC_STK) MBROPT(*REPLACE) /* DETAIL */ /* PAGES AND MAKES */ CVTSPLDBF FROMFILE(ABC_STOCK) SPLNBR(*LAST) + MAPNAME(ABC_DB_MAP 2) + TOFILE(CS_GLLIB/ABC_STK 2) MBROPT(*REPLACE) /* LOOP THROUGH THE SUMMARISED PAGE NUMBER AND CAR MAKE FILE TO DYNAMICALLY */ /* BUILD THE INCLFILE PARAMETER */ GET_MAKE: RCVF MONMSG MSGID(CPF 0864) EXEC(GOTO CMDLBL(END_MAKE)) CHGVAR VAR(&BADGE) VALUE(&MAKEOFCAR *TCAT &JPG) CHGVAR VAR(&PGN) VALUE(&PAGENO) CHGVAR VAR(&THECMD) VALUE(&THECMD *TCAT &SOB *TCAT + &SQ *TCAT &MAKE 1 *TCAT &BADGE *TCAT &SQ + *TCAT &MAKE 2 *TCAT &PAGENO *TCAT &SCB) GOTO CMDLBL(GET_MAKE) END_MAKE:
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Using CVTSPLPDF to create the PDF document. � The complete CL program continued. /*BUILD NEW BASIC REPORT*/ CALL PGM(ABC_STKR 2) /* PROCESS THE CVTSPLPDF COMMAND, USING QCMDEXC */ CHGVAR VAR(&THECMD) VALUE(&THECMD *TCAT &SCB) CALL PGM(QCMDEXC) PARM(&THECMD &CMDL) ENDPGM
Creating professional. PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) The completed PDF document is shown below.
- Slides: 54