View previous topic :: View next topic
|
Author |
Message |
Ibrahim85
New User
Joined: 29 Mar 2010 Posts: 4 Location: india
|
|
|
|
I have a csv file whose one row looks as follows -
12345,"London",5,"12-05-2009",198765,"UPSC","15-04-2010",...
I want to remove the double quotes from the columns 4 and 7 which contains date. Rest all the columns should remain as it is.
So output should look like -
12345,"London",5,12-05-2009,198765,"UPSC",15-04-2010,.. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why do you want to do that? If something is reading a delimited file, it should itself know what to do with "s... so why do they have to come off for one type of field? |
|
Back to top |
|
|
Ibrahim85
New User
Joined: 29 Mar 2010 Posts: 4 Location: india
|
|
|
|
The Analyst wants the date to be without quotes so that it can be loaded to informatica as "dates" and not "strings".
As per him if dates are in double quotes then Informatica will look at them as strings rather than dates. |
|
Back to top |
|
|
Ibrahim85
New User
Joined: 29 Mar 2010 Posts: 4 Location: india
|
|
|
|
@ Pandora
The DFSORT version we are using is
5694-A01, Z/OS DFSORT V1R12 |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Can't you select the date as CHAR? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
We also would like to see the ICExxx messages - especially the ICE201I message. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Assuming you only have quotes for 2,4,6,7 fields
Try the following.
1. Use INREC IFTHEN WHEN=INIT with FINDREP to replace 2nd field quotes to a special character (ex: @) and use DO=2. The DO will ensure only field2 quotes are replaced to @
2. Use IFTHEN WHEN=INIT with FINDREP to replace 4th field quotes to NULL and use DO=2. The DO will ensure only date quotes are removed.
3. Repeat step 1 as is to save field 6 and replace it with special character.
4. Repeat step 2 as is to remove quotes from field 7 the date field
5. Now use IFTHEN WHEN=INIT with FINDREP to replace the special character back to double quotes and use DO=4. |
|
Back to top |
|
|
Ibrahim85
New User
Joined: 29 Mar 2010 Posts: 4 Location: india
|
|
|
|
@ Dick Sherrer
ICE201I H RECORD TYPE IS V - DATA STARTS IN POSITION 5
ICE150I 1 VLSHRT NOT USED FOR SORT, MERGE, INCLUDE, OMIT OR SUM STATEMENT FIELDS
ICE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E9-K60824 C9-BASE E5-K72040 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Thanks.
Quote: |
ICE201I H RECORD TYPE IS V - DATA STARTS IN POSITION 5 |
The H indicates the specific fix-level for the code being run.
When there are new questions, it will help if you include the ICE messages and message ids. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Ibrahim85 wrote: |
The Analyst wants the date to be without quotes so that it can be loaded to informatica as "dates" and not "strings".
As per him if dates are in double quotes then Informatica will look at them as strings rather than dates. |
"Someone" is putting quotes around the dates. Why not fix it there, where the delimited file is created?
That aside, have you tried what Kolusu suggested? |
|
Back to top |
|
|
|