Have you ever thought of having your customers view their CA-Earl reports via an internet browser?
Viewing an CA-Earl Report via an Internet Browser. A how to instruction set.
In order to prepare an CA-Earl report to display on an internet browser, HTML (Hyper Text Markup Language) code must be added to the top and to the bottom of the CA-Earl report output.
Follow these steps:
Allocate the SYSEARL file. Below is a sample SYSEARL DD statement to add to the CA-Earl batch JCL. Note that the LRECL is 1 larger than the print line defined in the CA-Earl program used in this example. The second file is called FILEOUT and will be used in Step 5.
//SYSEARL DD DSN=sysearl.sequential.file, // DISP=(NEW,CATLG,DELETE), // UNIT=uuuu,VOL=SER=volid,SPACE=(TRK,(p,s)), // DCB=(DSORG=PS,RECFM=FB,LRECL=81,BLKSIZE=810) //FILEOUT DD DSN=your.file2, // DISP=(NEW,CATLG,DELETE), // UNIT=uuuu,VOL=SER=volid,SPACE=(TRK,(p,s)), // DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)
Run the first CA-Earl program to write the header HTML code to the beginning of the SYSEARL file:
INP: FILE CARD DEF HEADIN 1-80 X SYSEARL: FILE DISK OUTPUT RECORD=81 DEF HEADOUT 2-81 X SET HEADOUT = HEADIN PUT SYSEARL END <HTML> <HEAD><TITLE>EARL SAMPLE AS HTML</TITLE></HEAD> <BODY> <PRE> /*
Run the CA-Earl request to produce the desired report and append it to the end of SYSEARL. Note: DISP=MOD should be used on the SYSEARL DD to append the report.
Run the third CA-Earl request to append the trailing HTML code needed to make the report ready for the internet. Note: DISP=MOD should be used on the SYSEARL DD in this step.
INP: FILE CARD DEF HEADIN 1-80 X SYSEARL: FILE DISK OUTPUT RECORD=81 DEF HEADOUT 2-81 X SET HEADOUT = HEADIN PUT SYSEARL END </PRE> </BODY></HTML> /*
Run the CA-Earl request to remove carriage controls from the report in the SYSEARL file. FILEOUT will point to the second file that was created in step 1.
SYSEARL: FILE DISK INPUT RECORD=81 DEF INCC 1 - 2 X DEF INDATA 2 - 81 X FILEOUT: FILE DISK OUTPUT RECORD=80 DEF OUTDATA 1 - 80 X SET OUTDATA = INDATA PUT FILEOUT END
Download the data set for FILEOUT from Step 5 to the PC and display it via your internet browser.
Sample Request and Output
Here is a sample CA-Earl program and its resulting report:
OPTION PRINTER=80 AIRPORTS:FILE EARLGET RECORD=48 DEF A_NAME 1-18 X 'NAME OF' 'AIRPORT' DEF A_CITY 20-35 X 'CITY' DEF A_COUNTRY 37-39 X 'COUNTRY' 'ABBREVIATION' DEF A_PASS 41-48 N 'NUMBER OF' 'PASSENGERS' PIC 'ZZ,ZZZ,ZZ9' REPORT 'WORLD''S 50 BUSIEST AIRPORTS' PRINT @10 A_NAME @30 A_CITY @50 A_COUNTRY END
Here is what the report looks like when viewed with an internet browser after the HTML code has been added:
<Please see attached file for image>src="/servlet/servlet.FileDownload?file=0150c000004AKrJAAW" alt="" width="576" height="420">
This procedure is a sample and not a fully supported interface for CA Earl and your browsers. Customer utilize this information at their own discretion.