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
 
intrinsic function which conforms the PIC clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: intrinsic function which conforms the PIC clause
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

Senior Member


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

PostPosted: Mon Aug 30, 2010 7:34 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Aug 30, 2010 7:48 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm

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