Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataType SVP9(15) is converting the value to Decimal(16,0) instead of Decimal(16,16) #502

Closed
rohitavantsa opened this issue May 18, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@rohitavantsa
Copy link

rohitavantsa commented May 18, 2022

Hi @yruslan

We have a copybook with a field having datatype SVP9(15). When reading the file with cobrix we are expecting the value to be a decimal value with Decimal(16,16) but instead we are seeing Decimal(16,0) and also we are not seeing any decimal fields while checking the data. But our onprem is processing it as decimal fields .

expected Value : 0.123456789131230
but actual value in cobrix output is getting a INT.

Copybook:
01 TABLE_NAME.
10 random_field1 PIC X(05)
10 random_field2 PIC SVP9(15) COMP-3.

@rohitavantsa rohitavantsa added the question Further information is requested label May 18, 2022
@rohitavantsa
Copy link
Author

Hi @yruslan Can you help us understand this.

@yruslan
Copy link
Collaborator

yruslan commented May 19, 2022

This is probably a parser issue will take a look.

I have a question regarding scaling though. Shouldn't 'SVP9(15)' produce values like '0.012345' since 'P' indicates scaling. I'd expect:
PIC SV9(16) to read files like 0.1234567890123456 (maybe try using this PIC if if works for your use case)
PIC SVP9(15) to read as 0.0123456789012345 (since P goes after the decimal point

(see the spec) at word "his scales the value DOWN"

@rohitavantsa
Copy link
Author

Hi @yruslan ,
yeah we expect to read as 0.0123456789012345 from SVP9(15) .

@rohitavantsa rohitavantsa reopened this May 19, 2022
@yruslan yruslan added bug Something isn't working and removed question Further information is requested labels May 19, 2022
@yruslan
Copy link
Collaborator

yruslan commented May 19, 2022

We will take a look, so far looks like a bug.

@yruslan
Copy link
Collaborator

yruslan commented May 23, 2022

Hi, we are in the progress of fixing the bug. However, I've found a quick workaround.
You can use PIC SP9(15) (instead of SVP9(15)) to make precision and scale decode as you expect until the bug is fixed.

@rohitavantsa
Copy link
Author

Hi @yruslan ,

Thanks for the update.
We found we have another field having SVP9 (15) comp-3 . We will try to implement PIC SP9(15) this datatype and test our file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants