Author: Ralph Zbrog
Subject: Reply to: Casting a Binary Number to Numeric in Natural/ADABAS, or...
Posted: Thu Aug 11, 2016 1:59 am (GMT 5.5)
There is no built-in function, but sample Natural code has been posted/discussed on the SAG-L listserv, so do some research there. Years ago Jim Wisdom had an excellent routine on his Natural Conference website, but that's gone now, and I couldn't find other sites that used to have it cross-posted.
The RAND function is not part of Natural, but is available from SAG's Code Samples site: techcommunity.softwareag.com/ecosystem/communities/public/adanat/products/natural/codesamples.
DISPLAY, WRITE, and PRINT all format *TIMESTMP as hex because it is defined as Binary. There is no need for you to REDEFINE, etc.
All developers should have access to SYSEXT in a Development environment, but some Natural administrators fear that could result in the end of the world.
Once you have experience with the functions there, you can make a case for having a specific module made available in UAT & Production.
If your NatAdmin is stubborn, get a copy of Natural Community Edition and install it on Windows. Many of the API modules (i.e. SYSEXT) are common to mainframe. It's a great way to learn the API with no negative impact on the mainframe environment.
There are several modules in SYSEXT which deal with converstion from/to the various time formats, including *TIMESTMP.
_________________
Ralph Zbrog
LEN Consulting LLC
Subject: Reply to: Casting a Binary Number to Numeric in Natural/ADABAS, or...
Posted: Thu Aug 11, 2016 1:59 am (GMT 5.5)
Quote: |
is there any way to generate a random number in Natural |
The RAND function is not part of Natural, but is available from SAG's Code Samples site: techcommunity.softwareag.com/ecosystem/communities/public/adanat/products/natural/codesamples.
Quote: |
get the *TIMESTMP to display as Hex |
Quote: |
I don't have access to the SYSEXP library |

If your NatAdmin is stubborn, get a copy of Natural Community Edition and install it on Windows. Many of the API modules (i.e. SYSEXT) are common to mainframe. It's a great way to learn the API with no negative impact on the mainframe environment.
Quote: |
Does anyone know of a clever and/or elegant way to convert the B8 to an N8 |
_________________
Ralph Zbrog
LEN Consulting LLC