View previous topic :: View next topic |
Author |
Message |
Manudamodar Beginner
Joined: 10 Feb 2006 Posts: 7 Topics: 3
|
Posted: Fri Feb 10, 2006 11:19 am Post subject: DB2 Unload Query |
|
|
Hi
Iam using DSNTIAUL to unload a table to a sequential file. The current setup allows all date fields to be extracted in mm/dd/yyyy format. Is it possible to override this and extract it in ISO format i.e 'yyy-mm-dd'.
Is there any way I can do it other than using Scalar funtions on the date column to extract this info.
Sample Sysin JCL that I use is
//SYSIN DD *
SELECT *
FROM xxxxxxx ;
//SYSTSIN DD *
DSN SYSTEM(DSN)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) -
LIB('xxxx.xxxx.DSNLOAD') PARMS('SQL')
END
Thanks |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sat Feb 11, 2006 8:46 am Post subject: |
|
|
Manudamodar,
You can talk to your DBA and see if he can change the date format for the plan DSNTIAUL.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Mon Feb 13, 2006 4:05 am Post subject: |
|
|
The other way is not using "SELECT *" but coding every column in the Select clause. Instead of the date-columns you code ..., CHAR(date-column, ISO), ... or any other of the predefined formats DB2 gives you.
regards
Christian |
|
Back to top |
|
 |
sriramla Beginner
Joined: 22 Feb 2003 Posts: 74 Topics: 1
|
Posted: Mon Feb 13, 2006 1:52 pm Post subject: |
|
|
I would prefer to leave the unload as is (no scalar function to manipulate the data). Once unload is done, use SORT / FileAID to reformat the data the way you need. In my view this will be faster compared to DB2 functions. |
|
Back to top |
|
 |
|
|