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

Removing SPACES from a string using INSPECT verb


IBM Mainframe Forums -> FAQ & Basics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
satyasivaji_82

New User


Joined: 17 Mar 2007
Posts: 1
Location: Hyderabad

PostPosted: Fri Apr 27, 2007 12:37 pm
Reply with quote

I HAVE A FOLLOWING STRING 'ABC DEF GHI'. AND I WANT TO DISPLAY LIKE
'ABCDEFGHI' WITH OUT SPACES USING INSPECT VERB.HOW TO DO THIS,CAN ANY ONE SUGGEST ME.
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Fri Apr 27, 2007 2:33 pm
Reply with quote

Hi,

Its too complicated process if using the INSPECT verb.I think we can better go following logic using unstring and string


UNSTRING WS-MISC
DELIMITED BY ALL SPACES
INTO WS-WORD1 WS-WORD2 WS-WORD3
WS-WORD4 WS-WORD5 WS-WORD6
END-UNSTRING

STRING WS-WORD1 WS-WORD2 WS-WORD3
WS-WORD4 WS-WORD5 WS-WORD6
DELIMITED BY SPACES
INTO WS-MISC2
END-STRING

DISPLAY 'MISC2 ===>' WS-MISC2

Hope this will help you.

Cheers
Ashwin
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Fri Apr 27, 2007 3:38 pm
Reply with quote

satyasivaji_82 wrote:
I HAVE A FOLLOWING STRING 'ABC DEF GHI'. AND I WANT TO DISPLAY LIKE
'ABCDEFGHI' WITH OUT SPACES USING INSPECT VERB.HOW TO DO THIS,CAN ANY ONE SUGGEST ME.
The inspect verb can not do what you want, the string/unstring or just reference modification and a perform loop.

Please learn what the Caps Lock key is and how to use it.
Back to top
View user's profile Send private message
Sourav Banerjee

New User


Joined: 17 May 2007
Posts: 1
Location: kolkata

PostPosted: Thu May 31, 2007 4:17 pm
Reply with quote

Can you try out with - Inspect 'string' replacing all SPACES BY ''
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: Thu May 31, 2007 7:13 pm
Reply with quote

Hello and welcome to the forums icon_smile.gif

INSPECT will change a value to another - it does not remove them - it is not an editor.

Please look at the post before yours.

Before posting a suggestion (especially ont that that has already been advised against), you might try it on your system to make sure it works.
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 -> FAQ & Basics

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts file manager is doing string conversion IBM Tools 3
Search our Forums:

Back to Top