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

2 comments:

etailKing said...

Excellent work, sweetheart. Keep up the good work.

etailKing said...

Excellent work, sweetheart. Keep up the good work.