UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21. Read more.
UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21.Read more.
Ensign
Ensign
1076 views

Illegal Data in Numeric Field

Jump to solution

I am running NX51 and have code that has issues while compressing data. Essentially the program is compressing previously expanded data that was brought down from the Mainframe in ASCII. This code has been in Production for some years but it appears it has a problem handling data that meets a certain criteria:

The below code is to compress data that has a single decimal in the definition of the compressed output. The input expanded data has 3 decimals so before this line is executed for example WS-PACKED-DATA-W-DECIMAL has +0000000000030.000.

01  WS-PACKED-DATA-W-DECIMAL               PIC S9(13)V9(3) COMP-3.

IF WS-DECIMAL-PLACES = 1                      
    COMPUTE  WS-PACKED-DATA-W-DECIMAL =       
            WS-PACKED-DATA-W-DECIMAL / 100.000

After this code is executed I see "Illegal data in numeric field" in WS-PACKED-DATA-W-DECIMAL

I am not sure what i am missing here.

This code works fine for decimals greater than 1 with the below code:

IF WS-DECIMAL-PLACES = 2                   
    COMPUTE  WS-PACKED-DATA-W-DEC-UNSIGN = 
            WS-PACKED-DATA-W-DEC-UNSIGN / 10

IF WS-DECIMAL-PLACES = 3                  
    COMPUTE  WS-PACKED-DATA-W-DEC-UNSIGN =
            WS-PACKED-DATA-W-DEC-UNSIGN / 1

 

0 Likes
1 Solution

Accepted Solutions
Ensign
Ensign

This has been resolved. Please ignore.

View solution in original post

0 Likes
1 Reply
Ensign
Ensign

This has been resolved. Please ignore.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.