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
 

 

Removing spaces from alphanumeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
beruoist

New User


Joined: 14 Nov 2007
Posts: 70
Location: mumbai

PostPosted: Fri Jan 09, 2009 4:51 pm    Post subject: Removing spaces from alphanumeric field
Reply with quote

I am having an Alphanumric field (A50).I need to remove the spaces from the present in that.

I used compress leaving no spaces but it is not working.

Code:

DEFINE DATA                           
LOCAL                                 
1 #I   (A25)                         
END-DEFINE                           
INPUT #I                             
COMPRESS #I INTO #I LEAVING NO SPACE 
DISPLAY #I                           
END                                   


  RESULT
                         
 #I abcd efg hij klmnio pqr
                           
            #I             
 ------------------------- 
                           
 ABCD EFG HIJ KLMNIO PQR   
                         


Am i missing something,any other workaround to achieve the same ??
Back to top
View user's profile Send private message

William Thompson

Global Moderator


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

PostPosted: Fri Jan 09, 2009 8:30 pm    Post subject:
Reply with quote

Can you display #I in a hex format to insure that the apparent 'spaces' are really x'40's?
Back to top
View user's profile Send private message
monasu1998

Active User


Joined: 23 Dec 2005
Posts: 176
Location: India

PostPosted: Sun Jan 11, 2009 5:50 pm    Post subject: Re: Removing spaces from alphanumeric field
Reply with quote

Hi beruoist,

If you want to remove the trailing spaces from the string then try the EXAMINE FULL with delete option.
e.g. EXAMINE FULL #string ' ' DELETE

beruoist wrote:
I am having an Alphanumric field (A50).I need to remove the spaces from the present in that.

I used compress leaving no spaces but it is not working.

Code:

DEFINE DATA                           
LOCAL                                 
1 #I   (A25)                         
END-DEFINE                           
INPUT #I                             
COMPRESS #I INTO #I LEAVING NO SPACE 
DISPLAY #I                           
END                                   


  RESULT
                         
 #I abcd efg hij klmnio pqr
                           
            #I             
 ------------------------- 
                           
 ABCD EFG HIJ KLMNIO PQR   
                         


Am i missing something,any other workaround to achieve the same ??
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 -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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