View previous topic :: View next topic
|
Author |
Message |
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
Hi All,
Is there any command to remove comma in the input as mentioned below
I/P:
Code: |
456,253.0000-
6,210.0000-
7,500.0000-
0.68540000L
1,500.00000000L SG 1,500.00000000L
500.00000000L SG 500.00000000L
500.00000000L SG 500.00000000L
300.00000000L SG 300.00000000L
200.00000000L SG 200.00000000L
350.00000000L SG 350.00000000L
600.00000000L SG 600.00000000L
12,500.00000000L SG 12,500.00000000L
5,000.00000000L SG 5,000.00000000L |
My O/P Should look like
Code: |
456253.0000-
6210.0000-
7500.0000-
0.68540000L
1500.00000000L SG 1500.00000000L
500.00000000L SG 500.00000000L
500.00000000L SG 500.00000000L
300.00000000L SG 300.00000000L
200.00000000L SG 200.00000000L
350.00000000L SG 350.00000000L
600.00000000L SG 600.00000000L
12500.00000000L SG 12500.00000000L |
I believe we can do with DFSORT as below. But i need as a command to implement. Please let me know if any ways.
Code: |
OPTION COPY
INREC FINDREP=(IN=C'","',OUT=C'') |
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
But i need as a command to implement. |
Not sure what you mean. Please elaborate.
You can remove the commas with an editor macro. For example, change any character to '' in column 4. And find all of the columns where a comma might be. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
do you mean removing the records that have a comma or replacing the comma with a space.
In your output file this record has disappeared
Code: |
5,000.00000000L SG 5,000.00000000L |
Gerry |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Using the CHANGE command almost works:
The problem is that the changed numbers are shifted to the left:
Code: |
456253.0000-
6210.0000-
7500.0000-
0.68540000L
1500.00000000L SG 1500.00000000L
500.00000000L SG 500.00000000L
500.00000000L SG 500.00000000L
300.00000000L SG 300.00000000L
200.00000000L SG 200.00000000L
350.00000000L SG 350.00000000L
600.00000000L SG 600.00000000L
12500.00000000L SG 12500.00000000L
5000.00000000L SG 5000.00000000L |
Is this satisfactory? |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
Yup, I know this C all command but it shifts one letter to left. That's the prob. Is there any other way without that? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
(supposed to be a NOT sign)
Will get rid of the comma but shift all lines.
Follow with a shift right command.
Repeat with second column (find the column where the comma is), but your shift has to be more tricky. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Why is this a problem (to "remove" the comma, shifting must occur or there would be an embedded blank)? Seems that the problem is the "not shifting" shifting the "other" records that do not have a comma. . . .
Why does the comma need to be removed and the decimal remains?
If you explain what is needed as well as what has been tried to solve it, we may be able to provide more useful replies |
|
Back to top |
|
|
|