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
 

 

Get a string without leading spaces in natural

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

New User


Joined: 05 Sep 2006
Posts: 18

PostPosted: Tue Nov 28, 2006 7:23 pm    Post subject: Get a string without leading spaces in natural
Reply with quote

Hi Folks,

I am new to NATURAL. In NATURAL programming how should i get a string without leading spaces. Is there any verb like INSPECT in COBOL.

Thanks,
Shah
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Nov 29, 2006 1:01 am    Post subject:
Reply with quote

Yes, the equivalent in NATURAL is EXAMINE.

O.
Back to top
View user's profile Send private message
Shah

New User


Joined: 05 Sep 2006
Posts: 18

PostPosted: Wed Nov 29, 2006 10:33 am    Post subject: Re: Get a string without leading spaces in natural
Reply with quote

Hi Ofer71,

Thanks for that. I need some more info. I have a question.

Question:

I have a string variable ABC (A79), this is initialized with 20 characters. While displaying this variable i am getting 59 spaces and the string is displaying from 60th position. How can i remove the spaces.

My target is while display i need only 20 characters (Means with out spaces).

Thanks in advance,
Shah
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Nov 29, 2006 11:51 am    Post subject:
Reply with quote

Shah -

before the display, add the following statement (assuming your variable name is ABC):
Code:
EXAMINE FULL ABC FOR ' ' DELETE


O.
Back to top
View user's profile Send private message
Shah

New User


Joined: 05 Sep 2006
Posts: 18

PostPosted: Wed Nov 29, 2006 1:03 pm    Post subject: Re: Get a string without leading spaces in natural
Reply with quote

Ofer,

Thanks , i will try this and let you know.

Thanks,
shah
Back to top
View user's profile Send private message
Shah

New User


Joined: 05 Sep 2006
Posts: 18

PostPosted: Wed Nov 29, 2006 5:08 pm    Post subject: Re: Get a string without leading spaces in natural
Reply with quote

Ofer,

I got that but not exactly. i need some more info. As per your EXAMINE verb, her i am getting first 20 characters following spaces. Now my requirement is, output will be only text without spaces.

Please help.

Thanks in advance,
Shah
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Nov 29, 2006 8:31 pm    Post subject:
Reply with quote

You can find the ending position of the string after the EXAMINE, but that won't help you, since NATURAL always pad variables with blanks.

O.
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
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm


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