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

Removecommand


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Wed Aug 26, 2009 9:04 pm
Reply with quote

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

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu Aug 27, 2009 2:36 am
Reply with quote

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

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Aug 27, 2009 5:05 am
Reply with quote

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Aug 27, 2009 9:25 pm
Reply with quote

Using the CHANGE command almost works:
Code:
c ',' '' all

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

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Thu Aug 27, 2009 10:15 pm
Reply with quote

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

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Aug 28, 2009 3:05 am
Reply with quote

Code:
C p'^' ''  All 4

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

Moderator Emeritus


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

PostPosted: Fri Aug 28, 2009 3:13 am
Reply with quote

Hello,

Quote:
That's the prob.
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 icon_wink.gif
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 -> TSO/ISPF

 


Search our Forums:

Back to Top