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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am


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