Archives of the TeradataForum
Message Posted: Tue, 28 Jan 2003 @ 21:40:52 GMT
May God have mercy on your soul.
There are two ways to handle this:
1. Embed the Teradata SQL in your program just as you would DB2 SQL.
EXEC SQL DECLARE EMP_CUR CURSOR FOR SELECT EMP_NO, EMP_NAME, EMP_AGE, EMP_DOB, EMP_ADDRES, EMP_STATUS FROM EMPLOYE END-EXEC.
Then use the PP2 preprocessor to read the records, reformat them, and write them out.
2. Run FastExport and write an OUTMOD in Cobol to read the records, reformat them, and write them out. There is a white paper on the TDATA-L Web site that explains how to write exit routines in Cobol
it discusses INMODs, but the same basic principles apply to OUTMODs.
Are you asking how to do this in Cobol? If so, maybe you should find a Cobol expert in your shop. I believe the basic technique would be something like this.
a. Define the output record:
FD output-file block contains 0 records record contains 1 to 32760 characters label records standard. 01 output-rec. 03 output-rec-byte occurs 1 to 32760 depending on OUT-REC-LEN.
OUT-REC-LEN would be defined in Working-Storage:
77 OUT-REC-LEN PIC S9(9) COMP.
b. For each output record, string the input fields together like this:
string EMP_NO, '~', EMP_NAME, '~', EMP_AGE, '~', EMP_DOB, '~', EMP_ADDRES, '~', EMP_STATUS, '~' delimited by size into [somewhere] end-string.
Compute the length of the output record, move it to OUT-REC-LEN, and write.
I know this is sketchy, but it should give you enough to go on.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|