Professional Documents
Culture Documents
PEOPLE CODE:
# include ‘setenv.sqc’
Begin-program
Do stdapi-init
Do get param
Do tab
Do stdapi-term
End-program
Begin-procedure getparam
Begin-select
Country
From ps_b55_sqrtbl
Where oprid=$prcs_run_cntl_id
End-select
End-procedure
Begin-select
Emplid (+1,1)
Name( ,15)
Country ( ,60)
From ps_employees
End-select
End-procedure
#include ‘stdapi.sqc’
!let $writefile=’C:\temp\b55_sqr.txt’
let $writefile=’C:\temp\b55_sqr.csv’
if file stat!=0
else
do write_Data
close 30
end-if
end-program
begin-procedure write_data
begin-select
emplid
name
country
monthly_rt
From ps_employee
End-select
End-procedure
!inbound file-integration
BEGIN-SETUP
BEGIN-SQL
END-SQL
END-SETUP
BEGIN-PROGRAM
LET $READFILE=’C:\TEMP\B55_IP.TXT’
DO FILE HANDLING
CLOSE 30
END-PROGRAM
BEGIN-PROCEDURE FILEHANDLING
IF #FILESTAT!=0
ELSE
WHILE 30
DO INSERTION
IF #END-FILE
BREAK
END-IF
PRINT ‘READ DATA COMPLETED’(1,1)
END-PROCEDURE
BEGIN-PROCEDURE INSERTION
BEGIN-SQL
VALUES($DEPTID,$EMPLID,$NAME);\
END-SQL
END-PROCEDURE
MULTIPLE REPORTS
This Is used to generate multiple outputs from the same data source.
- DECLARE-LAYOUT
- DECLARE- REPORT
- FOR-REPORT
- USE-REPORT
DECLARE-LAYOUT
This is used to define the different output formats generated using the multiple reports.
This is used in Begin-Setup section.
Based on number of outputs generated, that many number of DECLARE-LAYOUT commands
must be written in the Begin-Setup section.
Syntax:
Other commands
END-DECLARE
Example:
BEGIN-SETUP
DECLARE-LAYOUT EMPDET
#INCLUDE ‘setup02.sqc’
END-DECLARE
DECLARE-LAYOUT PAYSLIP
#INCLUDE ‘setup01.sqc’
END-DECLARE
DECLARE-LAYOUT EMPTAB
END-DECLARE
END-SETUP
DECLARE-REPORT:
END-DECLARE
Example:
BEGIN-SETUP
DECLARE-REPORT EMPDET
LAYOUT= ‘EMPLDET’
END-DECLARE
DECLARE-REPORT PAYSLIP
LAYOUT= ‘PAYSLIP’
END-DECLARE
DECLARE-REPORT EMPTAB
LAYOUT= ‘EMPTAB’
END-DECLARE
END-SETUP
FOR-REPORT:
This is used to assign different heading and footing sections to different reports.
This is used in heading and footing sections.
Syntax:
PRINT commands
END-HEADING/ FOOTING
Example:
END-HEADING
END-HEADING
END-HEADING
END-FOOTING
END-FOOTING
USE-REPORT
This is used to assign different programs or procedure sections coding to the different reports.
This is used in program or procedure sections.
Syntax:
Commands
Commands
Example:
BEGIN-PROCEDURE PRINTING
USE-REPORT=’EMPLDET’
USE-REPORT=’PAYSLIP ‘
NEW-PAGE
USE-REPORT=’EMPTAB’
END-PROCEDURE