Midrange News for the IBM i Community


Posted by: Jeff Masak
IT Developer
The Boldt Co
Appleton, WI
Work with Edit Descriptions in Output Specs
has no ratings.
Published: 14 Nov 2012
Revised: 23 Jan 2013 - 1553 days ago
Last viewed on: 25 Apr 2017 (2626 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.

Work with Edit Descriptions in Output Specs Published by: Jeff Masak on 14 Nov 2012 view comments(7)

If you change an edit description QEDIT5-9 (user defined edit code) do the programs that use it need to be recomplied?

 

Jeff

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

COMMENTS

(Sign in to Post a Comment)
Posted by: RalphAMiller
Premium member *
Franklin, TN
Comment on: Work with Edit Descriptions in Output Specs
Posted: 4 years 5 months 11 days 9 hours 41 minutes ago

I think the program will continue to use the 'old' version of your edit code until you re-compile your program.

Posted by: jmasak
Premium member *
Appleton, WI
Comment on: Work with Edit Descriptions in Output Specs
Posted: 4 years 5 months 11 days 9 hours 15 minutes ago
Edited: Wed, 14 Nov, 2012 at 13:54:43 (1623 days ago)

Clarification:

We changed a user defined edit code QEDIT8 from integer mask ('   -  -    ') fill character '  ' for SS#

Before when program ran if the SS# had leading 0's it would trim them:

           ss# 001192012 would print as:    1-19-2012.

After chaning QEDIT8 from integer mask (' - - ') fill character 0 for SS# , it now prints the leading 0's.

           ss# 001192012 would print as: 001-19-2012.

The program has to be complied for this change to take effect. So now do I have to find all programs that use QEDIT8 and recomplie them as well?

 

Jeff

 

 

Posted by: jmasak
Premium member *
Appleton, WI
Comment on: Work with Edit Descriptions in Output Specs
Posted: 4 years 5 months 11 days 9 hours 13 minutes ago

So then is the edit code stored in the program?

 

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Work with Edit Descriptions in Output Specs
Posted: 4 years 5 months 11 days 9 hours 7 minutes ago
Edited: Wed, 14 Nov, 2012 at 14:05:01 (1623 days ago)

RPG tends to use hard-coded values for things like Edit Codes or Edit Words.

This means, yes a recompile would be necessary to see the updated edit code when program-described output is used. At compile-time, RPG pulls in the values and basically generates code that is (effectively) "hard-coded". Case-in-point, the %EDITC built-in function. You have to hard code an Edit Code on that built-in function because it generates the code necessary at compile-time, to produce the results.

If you had the APIs in your code, or called the function named EditCode() in COZTOOLS, you would have dynamic results, whereas using %EDITC or specifying the edit code on OUTPUT specs, hard-codes it to the program.

If you use it in DDS-based PRTF, I am going to speculate (because I do not know) you would not need to recompile the RPG program.

This is one of the reasons I recommend using the COZTOOLS'  function as follows:

   textSSN = EditCode( ssno : '8');

 Verses using %EDITC or output specs with an edit code--you can externalize the edits using EditCode, you can't using %EDITC or %EditW.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Work with Edit Descriptions in Output Specs
Posted: 4 years 5 months 11 days 8 hours 25 minutes ago
Edited: Wed, 14 Nov, 2012 at 14:45:27 (1623 days ago)

It's in RPG reference and also RPG/400 reference under editing numeric fields, "Remember that when a user-defined edit code is specified in a program, any system changes made to that user-defined edit code are not reflected until the program is recompiled."

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Work with Edit Descriptions in Output Specs
Posted: 4 years 5 months 11 days 8 hours 14 minutes ago
Edited: Wed, 14 Nov, 2012 at 17:13:57 (1623 days ago)

Just called IBM Toronto and they confirmed, Edit codes/words are compiled into the program--requiring a recompile if they're changed externally.

Dale, I looked into %EDITC and didn't see it documented there, but I already knew how it worked from years ago, writing the book. Just wanted to confirm that today it still had the same characteristics.

Posted by: Ringer
Premium member *
Comment on: Work with Edit Descriptions in Output Specs
Posted: 4 years 5 months 11 days 7 hours 27 minutes ago

Dang if I don't learn something new everyday.