IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to validate the length of an input varible


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
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
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: 2358
Location: Israel

PostPosted: Tue Jan 23, 2007 12:14 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts force tablespace using LISTDEF input DB2 1
Search our Forums:

Back to Top