Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to eliminate , in a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Compuware & Other Tools
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    Post subject: How to eliminate , in a file
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: 3158
Location: Tucson AZ

PostPosted: Tue Jun 12, 2007 4:49 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 12, 2007 4:59 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Jun 12, 2007 5:57 pm    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Jun 13, 2007 6:24 pm    Post subject:
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    Post subject:
Reply with quote

I agree with you dick.

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

Site Director


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

PostPosted: Wed Jun 13, 2007 11:32 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Compuware & Other Tools All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us