Question:
Is it possible to include the DB2 table column names within the same unload dataset as the unloaded data when executing CA Fast Unload for DB2 for z/OS (PFU)?
Answer:
PFU does not have a automated method to write the table column names to the unload / SYSREC dataset. Recommend the following method in PFU to complete this request:
The first SELECT are the column name literals and table creator.DUMMY is a stub table with 1 column and 1 row to facilitate unloading of the column name literals. Table creator.TABLE1 is the actual table to be unloaded.
//SYSREC DD DSN=
.
.
//SYSIN DD *
FASTUNLOAD
LOAD-CONTROL NONE
OUTPUT-FORMAT COMMA-DELIMITED
SQL-ACCESS NONE
AUTO-TAG-SIZE 0
OBJ-ORDER NONE
ONE-SYSREC
INPUT-FORMAT TABLE
SHRLEVEL REFERENCE
SELECT 'COLA', 'COLB' FROM creator.DUMMY;
SELECT * FROM creator.TABLE1;