cobrix icon indicating copy to clipboard operation
cobrix copied to clipboard

Missing SIgn for few fileds that are negative

Open devoplib opened this issue 1 year ago • 3 comments

I am using spark-cobol_2.11-2.6.9-bundle.jar to convert ebcdic file and there are a few negative values in the data file. We started getting positive values for a few columns which used to be negative. There is no change in the cobrix setup. We started to see positive values instead of negative values. It is not happening to all of them but happening to a few of them [example EOD_METRICSCARD_TPD_SVER_AMT ] not sure why this is happening. I appended both data and copy book files. When I run with .option("debug", "hex") I am seeing C at the end instead of D which for negative. We know for sure these fields should be metric and there is no change in the data file either. Any suggestion to debug the issue might help and appreciate your time.

devoplib avatar May 14 '24 15:05 devoplib

Forget to mention running the ebcdic conversion in Databricks environment.

devoplib avatar May 14 '24 17:05 devoplib

Hi, @devoplib,

A couple of questions from my side:

  • What is the definition of the field in the copybook?
  • Could you give some examples of correct and incorrect values and their HEX representation in the corresponding '_debug' column?
  • Is your input data EBCDIC or ASCII?
  • Do I understand correctly that you started to have positive numbers for columns that were negative for the exactly the same data?

yruslan avatar May 14 '24 18:05 yruslan

Definition of the fields is PIC S9(9)V9(2) COMP-3 Input data is EBCDIC EOD_METRICSCARD_TPD_SVER_AMT EOD_METRICSCARD_TPD_SVER_AMT_debug 367876.90 00036787690C ===> This should be 00036787690D Initially the values are Negative and Suddenly getting POSITIVE values for example for all the SVER AMT columns should be NEGATIVE but getting POSITIVE now as shown above.

Please let me know If any additional information is needed.

devoplib avatar May 15 '24 04:05 devoplib

EOD_METRICSCARD_TPD_SVER_AMT_debug shows exact bytes found in the file. From what I can see Cobrix parses BCD (COMP-3) numbers correctly. It seems the issue is at the place the source file is generated. 00036787690C is indeed 367876.90.

yruslan avatar May 16 '24 06:05 yruslan

Thank you very much for confirming it. We got the negative values earlier and data on s3 is not changed. It seems odd that suddenly negative sign is missing. I will copy new set of files and retest it.

devoplib avatar May 16 '24 14:05 devoplib