Wednesday, June 6, 2018


7.  What is the importance of DFTNAME(rpg_name)?
ü  The name for the compiled module/program is taken from the name specified in the DFTNAME keyword of the control specification.
ü  If the module name/program name is not specified on the control specification, and the source member is from a database file, the member name, specified by the SRCMBR parameter, is used as the module name/program name. If the source is not from a database file then the module name defaults to RPGMOD.




6.  What is the importance of DEBUG{(*NO | *YES)} and opcode DUMP?
ü  If DEBUG(*YES) and opcode DUMP is used then while an error, it generates dump of error else if DEBUG(*NO) and opcode DUMP is used then it does not generates dump.
ü  Notice that there is an H-spec specifying Debug(*Yes). This is a requirement when using the Dump opcode at releases earlier than V5R1.
ü  We can override keyword DUMP by specifying operation extender A (e.g. DUMP(A)). This operation extender means that a dump is always performed, regardless of the value of the DEBUG keyword.



5.  List of types of control specification keywords used in RPG IV/free format?
ü  There are 2 types of keywords associated with control specification:
o    Control-Specification
§  ALTSEQ{( *NONE | *SRC | *EXT )}
§  COPYNEST( n )
§  COPYRIGHT('copyright string')
§  CURSYM(' sym ')
§  DATEDIT( fmt { separator })
§  DATFMT(fmt{ separator })
§  DEBUG{(*NO | *YES)}
§  DECEDIT(*JOBRUN | 'value')
§  DFTNAME( rpg_name )
§  EXPROPTS{(*MAXDIGITS | *RESDECPOS)}
§  FLTDIV{(*NO | *YES)}
§  EXTBININT(*NO | *YES)
§  FORMSALIGN{(*NO | *YES)}
§  FTRANS{(*NONE | *SRC)}
§  NOMAIN
§  TIMFMT( fmt { separator })

o    Control-Specification Compile-Option
§  ACTGRP(*NEW | *CALLER | 'activation-group-name')
§  ALWNULL(*NO | *INPUTONLY | *USRCTL)
§  AUT(*LIBRCRTAUT | *ALL | *CHANGE | *USE | *EXCLUDE | 'authorization-list-name')                                                        
§  BNDDIR('binding-directory-name' {:'binding-directory-name'...})
§  CVTOPT(*{NO}DATETIME *{NO}GRAPHIC *{NO}VARCHAR *{NO}VARGRAPHIC)
§  DFTACTGRP(*YES | *NO) 
§  ENBPFRCOL(*PEP | *ENTRYEXIT | *FULL)
§  FIXNBR(*{NO}ZONED *{NO}INPUTPACKED)
§  GENLVL(number)
§  INDENT(*NONE | 'character-value')
§  LANGID(*JOBRUN | *JOB | 'language-identifier')
§  OPTIMIZE(*NONE | *BASIC | *FULL)
§  OPTION(*{NO}XREF *{NO}GEN *{NO}SECLVL *{NO}SHOWCOPY *{NO}EXPDDS *{NO}EXT *{NO}SHOWSKP *{NO}SRCSTMT *{NO}DEBUGIO)                                                         
§  PRFDTA(*NOCOL | *COL)
§  SRTSEQ(*HEX | *JOB | *JOBRUN | *LANGIDUNQ | *LANGIDSHR |'sort-table-name')                                          
§  TEXT(*SRCMBRTXT | *BLANK | 'description')
§  TRUNCNBR(*YES | *NO)
§  USRPRF(*USER | *OWNER)


3.  What is the importance of control/header specification in RPG IV?
ü  Control specification provide following functions:
o    Defaults formats for the program
§  h DATFMT(*ISO) TIMFMT(*ISO) CCSID(*UCS2:1200)
§  h datedit(*dmy) datedit(*DMY.)datedit(*DMY/)
§  h decedit('0,') dftname(XXXX)
o    Changes to normal processing modes
o    Special options to use when compiling the program
§  h OPTION(*SRCSTMT:*NODEBUGIO)DFTACTGRP(*NO) ACTGRP(*NEW)
o    Language environment that affect the entire program
o    h nomain – for not main sub-procedures

4.  How will you declare control specification in RPG free-format?
ü  ctl-opt;
examples:
ctl-opt datfmt(*iso) timfmt(*iso) ccsid(*ucs2:1200);
ctl-opt option(*srcstmt:*nodebugio) dftactgrp(*no) actgrp(*new);
ctl-opt dftactgrp(*no) actgrp(*caller) bnddir(‘binding directory name’);
ctl-opt datedit(*dmy) dftname(program name);
ctl-opt dftactgrp(*no) actgrp(*new)
option(*nodebugio)        
bnddir('XXXXXX')        
main(xxxxxx);       
ctl-opt main(startofpgm);
ctl-opt nomain;
ctl-opt debug(*XMLSAX);


1.  How many specifications are there in RPG IV? What are they?

There are seven specifications are exits in RPG IV. They are listed below:
o    Control Specification ( H)
o    File Description specification (F)
o    Definition specification (D)
o    Input specification (I)
o    Calculation specification (C)
o    Output specification (O)
o    Procedure specification (P)

2.  Is it necessary to define all specifications in RPG IV? Which are mandatory and which are optional?
No, all are optional.