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

intrinsic function which conforms the PIC clause


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
phdraju

New User


Joined: 30 Aug 2010
Posts: 2
Location: pune

PostPosted: Mon Aug 30, 2010 3:56 pm
Reply with quote

Hi,

Please help me if theirs any intrinsic function which conforms the PIC clause of the varaible and give returns boolean type 0 if variable does not conforms to the PIC clause and 1 if it confroms to the PIC clause.

01 new-var pic -9(5).99

Eg: Value in new-var is -12345.31 it should return 1 and
Value of new-var is invalid value is should return 0.

Thanks in advance.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Aug 30, 2010 7:34 pm
Reply with quote

AFAIK, there is no such COBOL Intrinsic Function. On the other hand, I'm not sure if "LENGTH OF" will fit to what you're wanting to do.

May be a little more explanation of what exactly you want to do can help us to help you.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Mon Aug 30, 2010 7:45 pm
Reply with quote

Are you looking for an intrinsic function that will test ANY type of data for conformation to ANY type of PICTURE clause? Or just the one you posted?

If just the one you posted, no intrinsic function is required - a simple IF statement will do what you want:
Code:
IF NEW-VAR IS NUMERIC
   imperative-statement-1
ELSE
   imperative-statement-2
END-IF.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 30, 2010 7:48 pm
Reply with quote

Hello and welcome to the forum,

There is no intrinsic function that i'm aware of. . .

How might you get a value into this field that does not conform? The field definition would typically be an output field. When a pic s(5)v99 comp-3 field is moved to new-var, new-var will conform. . . If the comp-3 field is not valid, look for an abend.
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Wed Sep 01, 2010 4:44 am
Reply with quote

The numeric test can only be applied to numerical edited items or packed decimal items. Character items (PIC X) or binary (PIC 9 COMP) items can not be tested by any built-in conditions.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top