Midrange News for the IBM i Community


Posted by: Chris Proctor
Programmer Analyst
Columbia Sports Company
Portland, OR
Fixing '40404040' in a numeric field
has no ratings.
Published: 19 Jul 2012
Revised: 23 Jan 2013 - 1703 days ago
Last viewed on: 22 Sep 2017 (3683 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Fixing '40404040' in a numeric field Published by: Chris Proctor on 19 Jul 2012 view comments(5)

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Fixing '40404040' in a numeric field
Posted: 5 years 2 months 6 days 7 hours 29 minutes ago
Edited: Thu, 19 Jul, 2012 at 11:55:26 (1891 days ago)

If the file is externally Described, then write a simple RPG program that reads and updates the file. That will probably fix it.

 

H FIXNBR(*ZONED : *INPUTPACKED)

FmyFile UF   E   DISK

 /free

    *INLR = *ON;

     read myFile;

     dow NOT %EOF();

     update myFile;  // Might need record format instead

    read myFile;

    enddo;

 /end-free

 

 

Posted by: chrisp
Premium member *
Portland, OR
Comment on: Fixing '40404040' in a numeric field
Posted: 5 years 2 months 6 days 7 hours 27 minutes ago

Thanks, Bob. I compiled the program with the fixnbr parms, but wasn't updating every record. I'll give it a shot!

 

Posted by: chrisp
Premium member *
Portland, OR
Comment on: Fixing '40404040' in a numeric field
Posted: 5 years 2 months 6 days 7 hours 10 minutes ago

That did it, Bob! Thanks again!

Posted by: RalphAMiller
Premium member *
Franklin, TN
Comment on: Fixing '40404040' in a numeric field
Posted: 5 years 2 months 11 hours 57 minutes ago

By the way Sir, did you find the program which generated the blanks in your numeric field? 

Posted by: Ringer
Premium member *
Comment on: Fixing '40404040' in a numeric field
Posted: 5 years 1 months 27 days 8 hours 18 minutes ago

Is likely from a file defined as LVLCHK(*NO). When such as file is opened, OS400 will detect if the actual file record length is different (typically longer) than the record length defined in the compiled program object. This can happen when a new field is added to a file and programs using that new field are not recompiled. If so, OS400 pads out the shorter record length with blanks. If that uncompiled program then WRITEs a record to the file and the new file field unknown to the program is numeric, boom, the new record has blanks in the numeric field. If the new field is character, no problem, blanks are ok.

Chris R