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.
If you change an edit description QEDIT5-9 (user defined edit code) do the programs that use it need to be recomplied?
Jeff
I think the program will continue to use the 'old' version of your edit code until you re-compile your program.
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
So then is the edit code stored in the program?
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.
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."
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.