Unload with data conversion using scalar functions


This example shows the use of scalar functions to convert column data. It adds two numeric columns and extracts the month and day characters from a DATE column.

Information
Example
//UNLOAD   EXEC PGM=NGTUTIL,PARM='ssid,,NORESTART'          
//*                                                         
//UTPRINT   DD SYSOUT=*                                     
//SYSPRINT  DD SYSOUT=*                                     
//SYSTSPRT  DD SYSOUT=*                                     
//OBJREPRT  DD SYSOUT=*                                     
//*                                                         
//SYSIN     DD *                                            
 OUTPUT SYSREC  DSNAME hlq.OUTDATA.&TS..P&PART..T&TIME
 UNLOAD                                                    
   DIRECT YES                                              
      SELECT col01 + col10,
             SUBSTR(CHAR(DATE(col02)),6,10)
        FROM creator.table                            
       WHERE col01 < 20                                    
/*

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Unload for Db2 13.1