Wednesday, March 5, 2008

Fun Series with iSeries - 05 Mar 2008 - Maheedar

1. What are the maximum no of Monmsgs that a CL can handle?
100
2. How can we display a window with out having a window record format in the display file?
QUILNGTXT
3. If all the indicators (1 - 99) are used in a program, how do we set the display file field attributes with out reusing the already used indicators.
DSPATR(&Attr) and Program to System fields (P-Fields)
4. How many files can be declared in a CL program?
5
5. How to refer to the fields of a file when multiple files are declared in CL?
&OPNID_Field Name
6. How to put a file in commitment control dynamically in a RPGLE program?
COMMIT(Variable)
7. How can we send multiple attachments at a time through email using AS400 program?
QtmmSendMail
8. What difference between '+' sign and '-' in the end of the line of CL program?
The difference is that all the blanks in the next record that precede the first non-blank character are ignored when a plus sign is coded and included when a minus sign is coded.

9. If I change the text for a source, is there any other way to reflect that change in the text of the object other than compilation?
Yes. Use CHGPGM command to change the object text of a CL program without recompiling the program. The CHGPGM command automatically recompiles the program with the changed text. However, the attribute FRCCRT should be (*YES) on CHGPGM command for automatic compilation.
10. The maximum number of sub files that can be active at a time?
12
11. What is the default value for the number of increments for the physical file?
3
12. How to include copy books while debugging the RPG program?
Compile the program with *COPY compiler option
13. What happens if a file is created with expiry date less than current date?
If a file is created with EXPDATE less than current date the file gets created but member is not added on creation. An error message is sent at the time of creation saying that the EXPDATE is invalid

14. How to send a break message from RPG program?
You can use the API QEZSNDMSG. Break messages can be sent to work station queues only. This API will derive all the work station IDs to which a given user is signed on and a break message is sent to all those work stations.