Val in Natural

Software AG's platform-independent programming language with full support for open-source and Internet applications
diptisaini1
Posts: 4
Joined: Fri Jun 26, 2009 12:01 am
Skillset: cobol,jcl,vsam,db2,cics
Referer: from my freind

Val in Natural

Postby diptisaini1 » Sun Nov 24, 2013 5:18 pm

I need some information about "VAL" use in Natural. As far as I know it will fetch the numeric value from a alphanumeric variable as mentioned below :-

Reset #a (A30) init <'1A'>
Reset #B (N2)
#B := VAL(#A)
Display #B
The output will be #B = 1.

Now here my doubt is if #a contain no numeric data as mention below :

Reset #a (A30) init <'AB'>
Reset #B (N2)
#B := VAL(#A)
Display #B

What will be the value of #B ?

Thanks in Advance!

User avatar
dick scherrer
Global moderator
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am

Re: Val in Natural

Postby dick scherrer » Mon Nov 25, 2013 10:28 pm

Hello,

What happens when you run this?

We do not have adabas/natural so i can't run a test here.
Hope this helps,
d.sch.