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.
Wednesday, March 5, 2008
Wednesday, February 6, 2008
Fun Series with iSeries - 06 Feb - Swetha
1.How can I retrieve an IP address of a session AS400?
a. (QDCRDEVD API)
2. Which is the better option to write a transaction (order header and detail transaction) using two physical files or one join logical file(on those two physical files) in a program and why ?
a. Using two physical files is the better option because records can't be written through join logical file.
3. What is the disadvantage of using Global variable?
a. We can not trace out at which point the value of variable is changed.
4. How many triggers can be associated with a file?
a. 6(Maximum)
5. How many types of objects are there on As/400?
"
a. 80
6.Which of the following types of activation groups is automatically
deleted when the last program in the call stack ends?
A. QILE
B. *CALLER
C. *NEW
D. named
a. *NEW
7.Based on the following example, the value of Result is how
many months?
Dname+++++++++++ETDsFrom+++To/L+++Idc.Functions. . . . . .
D Date_A S D INZ(D'1997-01-31')
D Date_B S D INZ(D'1997-04-30')
D Result S 3P 0
*
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq.
C Date_B SubDur Date_A Result:*Months
a.2months
8.If the last record of a file has been read, and the next operation on
that file is a READ operation, what will be the values of the input
fields for that file?
A. They will be blank and/or zero.
B. They will be null.
C. They will equal the values of the first record in the file.
D. They will equal the values of the last record read.
a. D
9. The DATFMT Keyword allows you to specify which three of the
following date formats?
A. *USA
B. *MDYC
C. *ANSI
D. *YDM
E. *JUL
F. *ILE
G. *ISO
H. *SAA
a. A,E,G
10. In a program using the control level indicators L1, L2, and L3, in
what sequence are control level calculations processed at LR time?
A. L1, L2, L3, LR
B. LR, L3, L2, L1
C. Only LR calculations are processed.
a. A
11.Which of the following contains only invalid operation code extender?
a. H, M, P
b. N, P, Z
c. H, N, P
d. H, L, N
a. D
12. Which of the following contains only valid File Specification keywords?
a. IGNORE, MAXDEV, SFLLIN
b. SFILE, CALLP, INCLUDE
c. INDSP, INFDS, PREFIX
d. PGMNAME, PLIST, RECNO
e. none of the above
a. E
13. What is the maximum width we can give to report ?
a. 378
14. What is use of Keyword FROMFILE ?
a. The FROMFILE keyword specifies the file that contains the input data for the prerun-time array or table being defined.
The FROMFILE keyword must be specified for every prerun-time array or table used in the
15. In what year was the AS/400 renamed the eServer iSeries?
a. (2000)
a. 1998
b. 1999
c. 2000
d. 2001
a. (QDCRDEVD API)
2. Which is the better option to write a transaction (order header and detail transaction) using two physical files or one join logical file(on those two physical files) in a program and why ?
a. Using two physical files is the better option because records can't be written through join logical file.
3. What is the disadvantage of using Global variable?
a. We can not trace out at which point the value of variable is changed.
4. How many triggers can be associated with a file?
a. 6(Maximum)
5. How many types of objects are there on As/400?
"
a. 80
6.Which of the following types of activation groups is automatically
deleted when the last program in the call stack ends?
A. QILE
B. *CALLER
C. *NEW
D. named
a. *NEW
7.Based on the following example, the value of Result is how
many months?
Dname+++++++++++ETDsFrom+++To/L+++Idc.Functions. . . . . .
D Date_A S D INZ(D'1997-01-31')
D Date_B S D INZ(D'1997-04-30')
D Result S 3P 0
*
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq.
C Date_B SubDur Date_A Result:*Months
a.2months
8.If the last record of a file has been read, and the next operation on
that file is a READ operation, what will be the values of the input
fields for that file?
A. They will be blank and/or zero.
B. They will be null.
C. They will equal the values of the first record in the file.
D. They will equal the values of the last record read.
a. D
9. The DATFMT Keyword allows you to specify which three of the
following date formats?
A. *USA
B. *MDYC
C. *ANSI
D. *YDM
E. *JUL
F. *ILE
G. *ISO
H. *SAA
a. A,E,G
10. In a program using the control level indicators L1, L2, and L3, in
what sequence are control level calculations processed at LR time?
A. L1, L2, L3, LR
B. LR, L3, L2, L1
C. Only LR calculations are processed.
a. A
11.Which of the following contains only invalid operation code extender?
a. H, M, P
b. N, P, Z
c. H, N, P
d. H, L, N
a. D
12. Which of the following contains only valid File Specification keywords?
a. IGNORE, MAXDEV, SFLLIN
b. SFILE, CALLP, INCLUDE
c. INDSP, INFDS, PREFIX
d. PGMNAME, PLIST, RECNO
e. none of the above
a. E
13. What is the maximum width we can give to report ?
a. 378
14. What is use of Keyword FROMFILE ?
a. The FROMFILE keyword specifies the file that contains the input data for the prerun-time array or table being defined.
The FROMFILE keyword must be specified for every prerun-time array or table used in the
15. In what year was the AS/400 renamed the eServer iSeries?
a. (2000)
a. 1998
b. 1999
c. 2000
d. 2001
Wednesday, January 2, 2008
Fun Series with iSeries - 02 Jan 2008 - Bodhi
1. What is dimension of the 2nd and 3rd fields of the API QCMDEXC
Ans: Length of command string Input Packed (15,5)
Optional Parameter: IGC process control INPUT Char(3)
2. I have a date variable, which I have initialised as
D myDate s d inz(d'2007-03-31')
myDate = myDate + %Months(1) ;
What will be the value in MYDATE
Ans: MYDATE = '2007-04-30'
3. How can we execute a CL command from RPG apart from API QCDEXC
Ans: D GoCmd PR 10I 0 Extproc('system')
D CmdString * Value
D Options(*String)
4. If the command that gets executed gets a CPF message, this message is stored in a global variable. This variable you can import in your program
Can any one tell me what is that variable and what is the dimension
Ans: D ExceptionMsg S 7A Import('_EXCP_MSGID')
5. In the SNDDST command we can send messages to the distribution list. Can you tell me how many characters
we can send thru the parameter MSG And LONGMSG. And how can you mention New Line and New Paragraph in your message.
Ans: MSG - 256
LONGMSG - 5000
New Line - /N
New Paragraph- /P
6. I have a packed variable of length 11P2 And the other 12P2.
Now, if I use the %Size to get the number of bytes.... how much will it show
Ans: 11P2 - 6
12P2 - 7 N/2 + 1
7. What is the length of the Timestamp field.
Ans: For the timestamp (Z) data type, the field length is 26. The format of a timestamp field is
yyyy-mm-dd-hh.mm.ss.mmmmmm
7B. Define a Char field in the Physical file which allocates a length of 5 and Max Length of 20
Fld1 20A VARLEN(5)
CREATE TABLE MyTable
(Varying VARCHAR (20),
Allocate5 VARCHAR (20) ALLOCATE(5))
8. If we write a syntax like numeric variable div by Zero will it compile....(RPG And CL)???
No... RPG Yes CL
9. Message Ids for
1. Attempt made to divide by zero for fixed point operation. - what is the error no?
A: MCH1211
2. Pointer not set for location referenced. - what is the error no?
A: MCH3601
3. If I say I am getting MCH0603, can you tell me what error I am reffreing to...
Range of subscript value or character string error
10. Max Record Length for a file - 99999
Ans: Length of command string Input Packed (15,5)
Optional Parameter: IGC process control INPUT Char(3)
2. I have a date variable, which I have initialised as
D myDate s d inz(d'2007-03-31')
myDate = myDate + %Months(1) ;
What will be the value in MYDATE
Ans: MYDATE = '2007-04-30'
3. How can we execute a CL command from RPG apart from API QCDEXC
Ans: D GoCmd PR 10I 0 Extproc('system')
D CmdString * Value
D Options(*String)
4. If the command that gets executed gets a CPF message, this message is stored in a global variable. This variable you can import in your program
Can any one tell me what is that variable and what is the dimension
Ans: D ExceptionMsg S 7A Import('_EXCP_MSGID')
5. In the SNDDST command we can send messages to the distribution list. Can you tell me how many characters
we can send thru the parameter MSG And LONGMSG. And how can you mention New Line and New Paragraph in your message.
Ans: MSG - 256
LONGMSG - 5000
New Line - /N
New Paragraph- /P
6. I have a packed variable of length 11P2 And the other 12P2.
Now, if I use the %Size to get the number of bytes.... how much will it show
Ans: 11P2 - 6
12P2 - 7 N/2 + 1
7. What is the length of the Timestamp field.
Ans: For the timestamp (Z) data type, the field length is 26. The format of a timestamp field is
yyyy-mm-dd-hh.mm.ss.mmmmmm
7B. Define a Char field in the Physical file which allocates a length of 5 and Max Length of 20
Fld1 20A VARLEN(5)
CREATE TABLE MyTable
(Varying VARCHAR (20),
Allocate5 VARCHAR (20) ALLOCATE(5))
8. If we write a syntax like numeric variable div by Zero will it compile....(RPG And CL)???
No... RPG Yes CL
9. Message Ids for
1. Attempt made to divide by zero for fixed point operation. - what is the error no?
A: MCH1211
2. Pointer not set for location referenced. - what is the error no?
A: MCH3601
3. If I say I am getting MCH0603, can you tell me what error I am reffreing to...
Range of subscript value or character string error
10. Max Record Length for a file - 99999
Tuesday, December 4, 2007
Fun Series with iSeries - 05 Dec 2007 - Malar
1. How to create Help for AS/400 Commands
GENCMDDOC
2. How to update/add record to a file in CL
RUNSQLSTM
3. How to send message to all the active employees of a system
• GO ASSIST and choose *ALLACT
• QEZSNDMSG API
•
4. Command to view or capture all the screen output from an active 5250 session.
STRCPYSCN
5. How to copy records from one file to another file, by which the duplicate records in the file is updated and the new records are added.
CPYF FROMFILE(F1) TOFILE(F2) MBROPT(*UPDADD)
6. In SQL, how to order the selection list by a new order format
Select * from table order by locate(fld1, ‘B P A Z T’)
7. How to do Wild card selection in Open query
QRYSLT('FLDB *EQ %WLDCRD("ABC_*DEF*") ')
8. How to pass subfile records to a called program
OVRDSPF FILE(DSPA) SHARE(*YES)
9. How to select only 10rows from a file in SQL
SELECT * FROM TABLE FETCH FIRST 10 ROWS ONLY
10. How to change the attributes of the Display file field in run time.
Use P field and map it to the corresponding display file field. Assign the P Field with Hexa values. Each Hexa value represents a particular attribute.
11. How to perform case insensitive sorting in SQL
Change the sort sequence (SRTSEQ) to *LANGIDSHR
12. How to Display two subfiles at once in AS/400. Top and Bottom.
Write CTL1
EXFMT CTL2
Read CTL1
13. How to run commands from the SQL Session
CALL QCMD
14. How to make a SBMJOB to run at a specific date and time
SCDDATE and SCDTIME option in the SBMJOB Command
15. How to add colors to the source text
Map the Key board to the corresponding APL Codes.
GENCMDDOC
2. How to update/add record to a file in CL
RUNSQLSTM
3. How to send message to all the active employees of a system
• GO ASSIST and choose *ALLACT
• QEZSNDMSG API
•
4. Command to view or capture all the screen output from an active 5250 session.
STRCPYSCN
5. How to copy records from one file to another file, by which the duplicate records in the file is updated and the new records are added.
CPYF FROMFILE(F1) TOFILE(F2) MBROPT(*UPDADD)
6. In SQL, how to order the selection list by a new order format
Select * from table order by locate(fld1, ‘B P A Z T’)
7. How to do Wild card selection in Open query
QRYSLT('FLDB *EQ %WLDCRD("ABC_*DEF*") ')
8. How to pass subfile records to a called program
OVRDSPF FILE(DSPA) SHARE(*YES)
9. How to select only 10rows from a file in SQL
SELECT * FROM TABLE FETCH FIRST 10 ROWS ONLY
10. How to change the attributes of the Display file field in run time.
Use P field and map it to the corresponding display file field. Assign the P Field with Hexa values. Each Hexa value represents a particular attribute.
11. How to perform case insensitive sorting in SQL
Change the sort sequence (SRTSEQ) to *LANGIDSHR
12. How to Display two subfiles at once in AS/400. Top and Bottom.
Write CTL1
EXFMT CTL2
Read CTL1
13. How to run commands from the SQL Session
CALL QCMD
14. How to make a SBMJOB to run at a specific date and time
SCDDATE and SCDTIME option in the SBMJOB Command
15. How to add colors to the source text
Map the Key board to the corresponding APL Codes.
Wednesday, October 3, 2007
Fun Series with iSeries - 3 Oct 2007 - Raju
Non-Technical
1. When was AS/400 introduced? ( June 1988)
2. What was the original code name for AS/400? (Silver Lake)
3. When the AS/400 was introduced in June 1988, how many processor models were there? (6 models)
a. 5
b. 6
c. 7
d. 8
4. What kind of performance did the AS/400 offer over the System/36? (5 times)
a. 5 times the performance
b. 7 times the performance
c. 8 times the performance
d. 10 times the performance
5. The 250,000th AS/400 was sold in 1994 to which company? (Coca-Cola)
a. Coca-Cola Co.
b. Pepsi-Cola Co.
c. Dr Pepper/Seven-Up, Inc.
d. National Beverage Corp.
6. Approximately how many applications were available for the AS/400 when the first one shipped in 1988? (2,500)
a. 1,500
b. 2,000
c. 2,500
d. 3,000
7. In what year was the AS/400 renamed the eServer iSeries? (2000)
a. 1998
b. 1999
c. 2000
d. 2001
8. Today, how many operating system environments can be run simultaneously from a single iSeries server? (4 - OS/400, Unix, Windows NT/2000, Linux)
a. 2
b. 3
c. 4
d. 5
9. What is latest system of AS/400 called? (System i)
10. What is the full form of TIMI? (Technology Independent Machine Interface)
Used on IBM System i platform. Allows application programs to take advantage of advances in hardware and software without recompilation. TIMI is a virtual instruction set; it is not the instruction set of the underlying CPU. User-mode programs contain both TIMI instructions and the machine instructions of the CPU, thus ensuring hardware independence.
The TIMI instructions are stored within the final program object, in addition to the executable machine instructions. This is how application objects compiled on one processor family (e.g. the original CISC AS/400 48-bit processors) could be moved to a new processor (e.g. PowerPC 64-bit) without re-compilation.
Technical
1. How can i tell if the program is running in batch or interactive? (QUSRJOBI API, the Job Type field (QUSJT04) will contain a B for batch or I for interactive)
2. What does %REM return? (Returns an Integer Remainder)
3. When a record is not found in READPE, what will be the value of the equal indicator? (Set ON)
4. When a record is not found in SETLL, what will be the value of High indicator?(Off)
5. How to access a specific member in SQL? (Create an ALIAS with SQL)
6. How can I retrieve an IP address of a session AS400? (QDCRDEVD API)
7. What is the command to create an activation group?(no command. Only we can control the creation of an activation group)
8. How to determine if a specific spool file exits? (QUSRSPLA)
9. There is no key field defined on the file can I use SETLL on this file? (Yes)
10. Max number Printer files that can be specified in an RPG IV program? (8)
1. When was AS/400 introduced? ( June 1988)
2. What was the original code name for AS/400? (Silver Lake)
3. When the AS/400 was introduced in June 1988, how many processor models were there? (6 models)
a. 5
b. 6
c. 7
d. 8
4. What kind of performance did the AS/400 offer over the System/36? (5 times)
a. 5 times the performance
b. 7 times the performance
c. 8 times the performance
d. 10 times the performance
5. The 250,000th AS/400 was sold in 1994 to which company? (Coca-Cola)
a. Coca-Cola Co.
b. Pepsi-Cola Co.
c. Dr Pepper/Seven-Up, Inc.
d. National Beverage Corp.
6. Approximately how many applications were available for the AS/400 when the first one shipped in 1988? (2,500)
a. 1,500
b. 2,000
c. 2,500
d. 3,000
7. In what year was the AS/400 renamed the eServer iSeries? (2000)
a. 1998
b. 1999
c. 2000
d. 2001
8. Today, how many operating system environments can be run simultaneously from a single iSeries server? (4 - OS/400, Unix, Windows NT/2000, Linux)
a. 2
b. 3
c. 4
d. 5
9. What is latest system of AS/400 called? (System i)
10. What is the full form of TIMI? (Technology Independent Machine Interface)
Used on IBM System i platform. Allows application programs to take advantage of advances in hardware and software without recompilation. TIMI is a virtual instruction set; it is not the instruction set of the underlying CPU. User-mode programs contain both TIMI instructions and the machine instructions of the CPU, thus ensuring hardware independence.
The TIMI instructions are stored within the final program object, in addition to the executable machine instructions. This is how application objects compiled on one processor family (e.g. the original CISC AS/400 48-bit processors) could be moved to a new processor (e.g. PowerPC 64-bit) without re-compilation.
Technical
1. How can i tell if the program is running in batch or interactive? (QUSRJOBI API, the Job Type field (QUSJT04) will contain a B for batch or I for interactive)
2. What does %REM return? (Returns an Integer Remainder)
3. When a record is not found in READPE, what will be the value of the equal indicator? (Set ON)
4. When a record is not found in SETLL, what will be the value of High indicator?(Off)
5. How to access a specific member in SQL? (Create an ALIAS with SQL)
6. How can I retrieve an IP address of a session AS400? (QDCRDEVD API)
7. What is the command to create an activation group?(no command. Only we can control the creation of an activation group)
8. How to determine if a specific spool file exits? (QUSRSPLA)
9. There is no key field defined on the file can I use SETLL on this file? (Yes)
10. Max number Printer files that can be specified in an RPG IV program? (8)
Subscribe to:
Comments (Atom)