View Full Version : Auto Code File Maintenance and varchar fields
Hugo A. Cantor
04-08-2010, 02:02 PM
I had a RPG compilation error while attempting to auto-generate a file maintenance program for a file with a varying length field (varchar). The automatically generated externally described file’s corresponding varying field is 2 bytes larger than the field in the file to be maintained. The DSs that use the auto file have the larger field which causes an error because the file to be maintained (in the F-specs) has the field with the original smaller length.
I tried it with a copy of the same file with the same field as non-varying and the program compiled correctly.
-thanks!
sean.lanktree
04-08-2010, 02:12 PM
Try adding the following lines of code to RPG program VVACCRTDDS, at statement 162:
dow ii<MAXFIELDS;
if fieldArray(ii).vvFldName<>*blanks;
srcseq+=1;
srcDta=' A '+fieldArray(ii).vvFldName;
if fieldArray(ii).vvFldLen<>0;
length=fieldArray(ii).vvFldLen;
else;
length=fieldArray(ii).vvFldByte;
if fieldArray(ii).vvVarying = '1';
length -= 2;
endif;
endif;
Hugo A. Cantor
04-08-2010, 04:16 PM
Sean,
Yes, that allowed the auto-generated RPG to be compiled. However, how do I know that a new version installation (one that may include VVACCRTDDS) will not override this change?
-thanks,
sean.lanktree
04-08-2010, 04:20 PM
The code that you added will be included in our base source.
richard.milone
04-08-2010, 04:22 PM
I just verified and this has been fixed on our base code so this will be automatically included in the next update.
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.