NonStop Servers
1825766 Members
1968 Online
109687 Solutions
New Discussion

Float values to REST API from Hp Nonstop

 
sailokesh
Occasional Collector

Float values to REST API from Hp Nonstop

Issue: Not able to send float values in restapi payload from Tandem to External world.

CSL-Studio: Data type in CSL studio is float

Generated Stub file:

TEMPERATURE NATIVE-4

On Tandem we have data type PIC 9(4)V9(3).


When we try to move these values to the TEMPERATURE NATIVE-4 We are getting only the first value before point

MOVE 1.4 TO TEMPERATURE 

Then I am getting only 1 in TEMPERATURE 

VHS Error:
Invalid input values

When we change the stub file:
TEMPERATURE PIC 9(1)V9(3)

Values looks good on Tandem side, 

MOVE 1.4 TO TEMPERATURE 

Here 1.4 in TEMPERATURE 

But the value is not passing to Server, It is coming as Zero.
"temperature": 0.000000 

Any help is appriciated and Thanks in advance.

3 REPLIES 3
Mr_Techie
Trusted Contributor

Re: Float values to REST API from Hp Nonstop

@sailokesh 

The issue is likely due to a data type mismatch between the Tandem system (PIC 9(4)V9(3)) and the external API. The key problems are:

Firstly that might be NATIVE-4 truncates the decimal part, keeping only the integer value.

Secondly, PIC 9(1)V9(3) correctly retains the decimal on Tandem but sends 0.000000 in the API.

Possible solutions are: 

Try using NATIVE-8 instead of NATIVE-4.>> Explicitly convert the value using FUNCTION NUMVAL(TEMPERATURE).>> Ensure the API expects float values correctly formatted (e.g., as a string).>> Ensure the API expects float values correctly formatted (e.g., as a string).>> The bebug the outgoing JSON payload to confirm the value before transmission.

I hope it helps. Let me know..

support_s
System Recommended

Query: Float values to REST API in Hp Nonstop

Hello,

 

Let us know if you were able to resolve the issue.

If you are satisfied with the answers then kindly click the "Accept As Solution" button for the most helpful response so that it is beneficial to all community members.

 

 

Please click on "Thumbs Up/Kudo" icon to give a "Kudo".


Accept or Kudo

sailokesh
Occasional Collector

Re: Float values to REST API from Hp Nonstop

Hi @Mr_Techie 

Thank you for your reply. It's not working.

When I put native-8, I am getting length invalid.

My server is expecting float values.