View previous topic :: View next topic |
Author |
Message |
cobcurious Beginner
Joined: 04 Oct 2003 Posts: 68 Topics: 25
|
Posted: Thu Apr 26, 2007 12:14 pm Post subject: Formatting character |
|
|
Hi,
I am using DB2, LOAD utlity. While loading the data, I want to replace character "/" in date field with a "." How can I do this ?
Thanks in advance
Cobcurious |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Apr 26, 2007 12:25 pm Post subject: |
|
|
cobcurious,
1. Code a FIELDPROC on the column
2. Run the load file thru an utility and replace the character
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
cobcurious Beginner
Joined: 04 Oct 2003 Posts: 68 Topics: 25
|
Posted: Thu Apr 26, 2007 12:29 pm Post subject: |
|
|
Can you please tell how to use FIELDPROC here ???
LOAD DATA
INDDN (SYSREC)
LOG NO
REPLACE
COPYDDN(SYSCP101)
INTO TABLE NMK.TAB (
RLTNSHP_STRT_DTE POSITION( 113: 122)
DATE EXTERNAL( 10),
RLTNSHP_END_DTE POSITION( 123: 132)
DATE EXTERNAL( 10) ) |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Thu Apr 26, 2007 2:40 pm Post subject: |
|
|
kolusu,
I am a little fuzzy on this but won't a fieldproc decode the value back when there is a select or an unload.
cobcurious,
Do you need the "/" permanently changed to "," ?
Regards,
Manas _________________ There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948) |
|
Back to top |
|
|
videlord Beginner
Joined: 09 Dec 2004 Posts: 147 Topics: 19
|
Posted: Fri Apr 27, 2007 1:09 pm Post subject: |
|
|
you can using DFSORT process the record before LOAD
try INREC/OUTREC OVERLAYY |
|
Back to top |
|
|
cobcurious Beginner
Joined: 04 Oct 2003 Posts: 68 Topics: 25
|
Posted: Tue May 01, 2007 12:19 pm Post subject: |
|
|
Hi,
Thanks to Kolusu and videlord for your time.
Videlord,
There is no doubt DFSORT would have been one of the best alternative to use but due to some time restrictions I was not keen on using it. Anyways,I would request you to please let me know how can we use it in this scenario.
Kolusu,
Since in my project, we don't have access to create database tables, FIELDPROC can't be used. I would appreciate if you can please suggest any other trick of getting around this problem.
Thanks again
Cobcurious |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
cobcurious Beginner
Joined: 04 Oct 2003 Posts: 68 Topics: 25
|
Posted: Tue May 08, 2007 1:38 pm Post subject: |
|
|
Hi Kolusu,
I have n't tried the above idea. The problem was solved by the data sender to correct the format in which the data was being sent.
I will definitely try using the scalar function.
Thanks very much for your time.
Thanks
Cobcurious |
|
Back to top |
|
|
|
|