IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to eliminate , in a file


IBM Mainframe Forums -> Compuware & Other Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gp_parag

New User


Joined: 11 Jun 2007
Posts: 2
Location: Chennai

PostPosted: Tue Jun 12, 2007 4:22 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jun 12, 2007 4:49 pm
Reply with quote

Don't know fileaid, but there have been several sort solutions posted here in the past.....
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 12, 2007 4:59 pm
Reply with quote

And REXX will do it too
Back to top
View user's profile Send private message
loga_nathan_m

New User


Joined: 07 Jun 2007
Posts: 40
Location: India

PostPosted: Tue Jun 12, 2007 5:46 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jun 12, 2007 5:57 pm
Reply with quote

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
View user's profile Send private message
gp_parag

New User


Joined: 11 Jun 2007
Posts: 2
Location: Chennai

PostPosted: Wed Jun 13, 2007 11:50 am
Reply with quote

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
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Wed Jun 13, 2007 12:02 pm
Reply with quote

Quote:
look for comma & then eliminate

COBOL INSPECT and REPLACE
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 13, 2007 6:24 pm
Reply with quote

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
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Wed Jun 13, 2007 8:56 pm
Reply with quote

I agree with you dick.

Please Ignore my response.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 13, 2007 11:32 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Compuware & Other Tools

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top