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
 

 

Removecommand

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Wed Aug 26, 2009 9:04 pm    Post subject: Removecommand
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

Senior Member


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

PostPosted: Thu Aug 27, 2009 2:36 am    Post subject: Reply to: Removecommand
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: 1703
Location: Australia

PostPosted: Thu Aug 27, 2009 5:05 am    Post subject:
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: 1228
Location: Israel

PostPosted: Thu Aug 27, 2009 9:25 pm    Post subject: Reply to: Removecommand
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: 680
Location: NJ

PostPosted: Thu Aug 27, 2009 10:15 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Aug 28, 2009 3:05 am    Post subject: Reply to: Removecommand
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

Site Director


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

PostPosted: Fri Aug 28, 2009 3:13 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:



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