Code:
Can I set up some default values for my control (H) specifications in an RPG program? Can I set up some default values for my control (H) specifications in an RPG program? A: Yes, the RPG compiler looks for control (H) specifications in two other locations, if none are specified in the program's source member: A data area called RPGLEHSPEC anywhere in the library list, and DFTLEHSPEC in library QRPGLE. For RPG/400, these data areas are called RPGHSPEC in *LIBL and DFTHSPEC in QRPG. To copy some RPG H specifications into every ILE RPG program, create a data area named RPGLEHSPEC and put the keywords and values in it. The data area can be as long as required to contain the keywords and values. Since the compiler stops looking as soon as it finds a valid control specification, you can replace the data area options by coding values in the H specifications of an individual program, or ignore everything in the data area by including a blank H specification. Be very careful of this last one. I had gotten out of the habit of using * on blank comment lines since it is not required in RPG IV, but a line with just an H in column 6 anywhere will ignore all the options in your data area, so be sure to always use H* for any blank lines. You could use this command: CRTDTAARA DTAARA(RPGLEHSPEC) TYPE(*CHAR) LEN(112) VALUE('Option(*SRCSTMT:*NODEBUGIO)') + TEXT('Default Control (H) Specs for RPG IV') Select "work with data areas type options" and press enter. On the compiler listing, the first pages will show the defaults for all the options, so it looks like your data area was ignored. Look farther down past the last H specification to see the effects of the override. And finally, be sure to document in your programs that you are using the data area to avoid driving maintenance programmers crazy in the future trying to identify the source of these compiler options.
Comment