Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Removing the period or dot from the v... gopinak COBOL Programming 6 Wed May 09, 2018 1:53 pm
No new posts How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us