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
 
How to validate the length of an input varible

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

New User


Joined: 04 Dec 2006
Posts: 44
Location: Pune,India

PostPosted: Tue Jan 23, 2007 10:32 am    Post subject: How to validate the length of an input varible
Reply with quote

Hi all,

Can anyone please tell me how to validate the lenght of an input varible?

My requirement here is to,accept a variable and if it's length is 8 or 10 , the remaining process is to be done.
But iam strugling to find out a built in for the length calculation.

So please provide the information as early as possible.

Many thanks in advance.

Prasanth
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Jan 23, 2007 12:14 pm    Post subject:
Reply with quote

I assume you are talking about NATURAL.

There is no built in function for length in NATURAL, but you can use the following method:
Code:
DEFINE DATA LOCAL                 
1 #A (A10)                         
1 #B (N2)                         
END-DEFINE                         
*                                 
#A := 'OFEROFEROF'                 
*                                 
EXAMINE #A FOR ' ' GIVING LENGTH IN #B
*                                 
WRITE #B                           
*                                 
END                               


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

New User


Joined: 04 Dec 2006
Posts: 44
Location: Pune,India

PostPosted: Tue Jan 23, 2007 1:23 pm    Post subject: Re: How to validate the length of an input varible
Reply with quote

ok...i tried this and it worked....!!!


Thanks ...offer 71:D
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
This topic is locked: you cannot edit posts or make replies. Selecting two copybooks of different ... Vignesh Sid COBOL Programming 8 Tue Sep 05, 2017 7:28 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am

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