MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DB2 Unload Query

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Manudamodar
Beginner


Joined: 10 Feb 2006
Posts: 7
Topics: 3

PostPosted: Fri Feb 10, 2006 11:19 am    Post subject: DB2 Unload Query Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sat Feb 11, 2006 8:46 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Mon Feb 13, 2006 4:05 am    Post subject: Reply with quote

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
View user's profile Send private message
sriramla
Beginner


Joined: 22 Feb 2003
Posts: 74
Topics: 1

PostPosted: Mon Feb 13, 2006 1:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group