This example passes data entered on a screen to a report. The script includes the customer format, runs the input screen and then the report, and the report picks up the customer code by including the same format.
Report definition
ENTRY-SECTIONDN START-CODE(6)! Include the format from the screen that holds the Customer CodeI101 FORMAT INCLUDE #I4FCUST, OPT="NONE"I102 LET START-CODE = #I4FCUST.CUST-CODEFILE-SECTION! Customer Code different size in each file.LN UTCUST SELECT WHEN CUST-CODE = START-CODE(1,4)CONTROL-SECTION
REPORT-SECTIONHH LL-RRRRRR XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH MM/DD/YYHD XXXX $###,###.00D XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXD XXXXXXXXXXXXXXXXXXXXD XXXXXXXXXXXXXXXXXXXX, XX XXXXXXXXXXScript source
MAINLINE FORMAT INCLUDE #I4FCUST ! Include customer format DIM SCREEN$[17] ! Dimension array LET SCREEN$[9]=$01$ ! Fields to maintain LET SCREEN$[13]="YY Y" ! Screen inicators LET SCREEN$[15]="F" ! set to logical screen CONNECT SCREEN "I4SCUST" ! Connect to the Screen for Input CONNECT REPORT "I4RCUSTF" ! Connect to the ReportNotes
- Both the script and the report include #I4FCUST. Because the script includes it first, the report sees the values entered on the screen. The report includes it with OPT=“NONE”.
- The customer code is a different size in each file, so the report selects on START-CODE(1,4).