View previous topic :: View next topic
|
Author |
Message |
gp_parag
New User
Joined: 11 Jun 2007 Posts: 2 Location: Chennai
|
|
|
|
Hi everyone,
need a solution for this problem...
A record in a file has contents like this
745,221,059
Using a fileaid command how can I eliminate the "," from this record
Could any one illustrate using a code |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Don't know fileaid, but there have been several sort solutions posted here in the past..... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
And REXX will do it too |
|
Back to top |
|
|
loga_nathan_m
New User
Joined: 07 Jun 2007 Posts: 40 Location: India
|
|
|
|
hi,
hope using fileaid you cannot eliminate a particular column.
you can only eliminate records depending on a particular condition.
u can eliminate the comma(,) by using sort command.
Code: |
input: 745,221,059
OUTREC FIELDS=(1:1,3,4:5,3,7:9,3)
SORT FIELDS=COPY
output: 745221059
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Keep in mind that the posted solution will only work if the value is exactly 9 digits and 2 commas. Often that may not be the case in the real data. |
|
Back to top |
|
|
gp_parag
New User
Joined: 11 Jun 2007 Posts: 2 Location: Chennai
|
|
|
|
Hi Loga,
I see ur solution with respect to the format I gave...
but my requirement is to look for comma & then eliminate it from the file.
The comma can occour anywhere say.
Could you help me out |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
Quote: |
look for comma & then eliminate |
COBOL INSPECT and REPLACE |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you inspect and find a comma, what would you replace it with?
Keep in mind that the commas are between some numbers, the numbers must be "shifted" together - "12,345,678" would become "12345678" not "12 345 678". |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
I agree with you dick.
Please Ignore my response. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What else is in this file? How many fields are there in a record? How many might have commas (or other punctuation) this might need to be removed?
Is this strictly a Compuware question or might some other tool be acceptable?
If better served, i will move this to a different place in the forums. . . |
|
Back to top |
|
|
|