View previous topic :: View next topic
|
Author |
Message |
suzeet
New User
Joined: 16 May 2005 Posts: 54
|
|
|
|
Hi
In a comma separated file, I am using UNSTRING delimited by ','. But in my input record one item(amount) is having "5,555.00". This amount field is not fixed length. i.e it may 4 to 9 depending upon value. Please help me out how should I accomplish |
|
Back to top |
|
|
nbalajibe Warnings : 1 New User
Joined: 28 Nov 2006 Posts: 75 Location: India
|
|
|
|
i can't get u...
u want to seperate the items of the specific field or the total record? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Well, is the file comma and quote delimited? If elements with commas imbeded within them are present, simple comma delimited is the wrong format.
Is there anything significant about the field prior to the amount? How about the relitive position of the amount field (line it is always the 6th element)? |
|
Back to top |
|
|
suzeet
New User
Joined: 16 May 2005 Posts: 54
|
|
|
|
Yeah it is the 8 th element of the copybook. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Copybook?
Well, when you reach the eighth element, a two phase unstring would work, first to the decimal point and then to the trailing comma. |
|
Back to top |
|
|
SSR Warnings : 1 New User
Joined: 26 Feb 2006 Posts: 38
|
|
|
|
Hi,
First move delimited based on '.' in to a variable, if you do not have dot anywhere else in the file. Then based on the position you can move the amount field in to a different variable and then delimit rest of the variable using ','.
Regards
SSR. |
|
Back to top |
|
|
|