Data Build Manual
Customizing SQL-LOAD Output
Customizing Data Build
099331 Tandem Computers Incorporated 6–21
?SECTION U-WS
01 CTR PIC 9(4) COMP VALUE 0.
?SECTION U-POST-PROCESS
* THE FOLLOWING PARAGRAPHS ARE PERFORMED BY USER EXIT CODE.
* THEY CAN BE PLACED HERE, OR IN THE U-PRE-PROCESS EXIT. ALL OF THE
* OTHER USER EXITS ARE PART OF PERFORMED PARAGRAPHS WHICH WILL BE
* TERMINATED PREMATURELY IF PARAGRAPH NAMES ARE INCLUDED.
*
* MAKE SURE TO INCLUDE THE GO TO STATEMENT SO THAT THESE PARAGRAPHS
* WILL NOT EXECUTE DURING THE U-POST-PROCESS EXIT.
GO TO USER-RTN-BYPASS.
RTN1.
MOVE 3 TO LEN OF DEM1-NAME OF OUT-DEMO01
MOVE DEM1-NAME OF IN-DEMO01 TO VAL OF DEM1-NAME OF OUT-DEMO01.
RTN2.
MOVE 0 TO LEN OF DEM1-NAME OF OUT-DEMO01
MOVE DEM1-NAME OF IN-DEMO01 TO VAL OF DEM1-NAME OF OUT-DEMO01
RTN-OTHER.
MOVE 25 TO LEN OF DEM1-NAME OF OUT-DEMO01
MOVE DEM1-NAME OF IN-DEMO01 TO VAL OF DEM1-NAME OF OUT-DEMO01.
USER-RTN-BYPASS.
?SECTION U-OUT-DEMO01-DEM1-NAME
ADD 1 TO CTR
EVALUATE CTR
WHEN 1 PERFORM RTN1
WHEN 2 PERFORM RTN2
WHEN OTHER PERFORM RTN-OTHER
END-EVALUATE.
13. OBEY XRUN.
14. Press F4 and check the spooler (F12).
15. Press F5 and check the spooler (F12)
16. Press F11 for SQLCI and enter the following commands to send the first 7 rows to
the spooler at #DEM1MOD:
SET LIST_COUNT 7;
OUT $S.#DEM1MOD;
SELECT * FROM =DEMO01;
EXIT;
Compare spooler results at #DEM1MOD with those run from #DEM1BE4.
Look at column DEM1_NAME.
The first row should contain "CRE", the first 3 characters of the name. Even
though all the name was moved into the output record, the length was set to 3.
The second row should be blank; the length was set to 0.
The rest of the rows should be as in the original data.
17. You can play with the code and add additional conditions.