1.For loop in RPGLE
DW@Count S 2P 0 Inz(2)
**
C For W@Count = 1 to 6 by 2
C W@Count Dsply
C EndFor
C Return
2.Use of TFRCTL
To transfer control completely to the called program and force the OS not to log specific program call, Use the TRFCTL (Transfer control).
3.Compile Time array
• DW@RTime S 5P 0 Dim(4) CTDATA PerRcd(2)
• D @Indx S 1P 0 Inz
• C Do 4 @Indx
• C W@RTime(@Indx)Dsply
• C EndDo
• **
• C Return
• **CTDATA W@RTime
• 0010100102
• 0010300104
4.How to comment CTDATA
There is no way od commenting the data for compiling time array.You only have to delete it.
5.Use of Read(E) File1
traps any error occurred while reading the File1 using the extender 'E'. Whether error occured or not during the read operation, can be verified by the %Error built in function. In case of error this return *On or '1'.
6.use of Read(N) File2
• The Read(N) opcode uses the extender N to 'read without lock'. When a file has been declared in update mode, the read operation results in a lock on File2. It means the record will not be available for any other program for updation unless you unlock it. If you are not doing this read for any updation, it is advised to use the 'N' extender to read without lock. This extender can be used with all other read operation like CHAIN(N), READE(N), READPE(N), READP(E) etc.
7.Update(E) RCD001
The Update(E) traps error occurred during updation.
8.C *ISO Test(DE) W@ABC
The Test(DE) tests whether w@ABC contains a valid *ISO date or not. In case of error the %Error function return *On or '1'.
9.difference between %scan & %check%scan-The result field contains the numeric value of the leftmost position of the compare string in the base string, if found.
XYZ SCAN ABCXYZ RESULT? = 4
(Factor 1 String is found starting at position 4 of Factor 2 String)
XYZ CHECK ABCXYZ RESLT1? = 1
(First position of Factor 2 String is not found in Factor 1 String)
10.Difference between DSPATR(PC) and CSRLOC
DSPATR(PC)
Positions the cursor on the first character of the field.
CSRLOC
Specifies the cursor location used when the record is displayed.
11.to see the userids of the users from RPG program?
Use the Program Data Structure (SDS) in D-Spec.Positions 254 to 263 gives you the user running th program
12.To see the userids from CL program?
RTVUSRPRF
13.How we will read call stackfor a job?
wrkjob+option 11
14.How can we find out whether the job is interactive or Batch through RPG program?
QUSRJOBI API can be used to find out whether the job is interactive or batch from RPG program Field QUSJT04 will contain B for batch or I for interactive
15.How can we find out whether the job is interactive or Batch through CL program?
RTVJOBA
Search This Blog
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment