Skills in AS/400 Programming:
1.Src Version: Release/Debug
StrDbg for RPGLE/CLLE debuging;
StrIsDb for RPG/CLP debuging.
2.RPG->RPGLE: Use 'CvtRpgSrc' command
3.To init a DS which was mixed of type A and S/P,USE Clear
eg. Move *Blanks Nbr // Nbr Dsply 0
Move *Blanks aDS // aDS.Nbr Dsply (Decimal-data error occurred)
So initialize a DS,Use 'Clear'
5. Select When ...
If more than one brach satisfied, Only excute the first one.
6. %Char() Test
Z-Add 1 wNbr 8 0
Eval wStr = %Char(wNbr)
wNbr DSPLY 1
wStr DSPLY 1
Z-Add 1 wNbr 8 0
Move wNbr wStr 8
wNbr DSPLY 1
wStr DSPLY 00000001
7. Time
Result Field Value Returned Format
6-digit Numeric Time hhmmss
12-digit Numeric Time and Date hhmmssDDDDDD
14-digit Numeric Time and Date hhmmssDDDDDDDD
Time Time Format of Result
Date Date Format of Result
Timestamp Timestamp *ISO
eg.
C TIME TimStp 14 0
C MOVEL TimStp Time 6 0
C MOVE TimStp SysDat 8 0
8. OpCod Hi Lo Eq
Chain NF
9.Build-in Funtion
Record format can not write in ( )
If %FOUND(FTrxR) Wrong!
If %EOF(FMchR) Wrong!
If %FOUND(SsTrxDtaL1) Right!
If %EOF(SsMchDtaL1) Right!
10. Clear Usage
C *NOKEY Clear *ALL RecordFormat
// If *All specified,it will clear all fields in record format
// If *NOKEY specified,key fiedls are not cleared even if *ALL is specified.
11. Use RPG in C Program
//Define Record DS
#pragma mapinc("TranStru", "FCMSIFP(FCIFR)","both","")
#include "TranStru"
//Define PGM Procedure
#pragma map(CalculateDESMAC, "FCMAGNR")
#pragma map(CompWorkingKey, "FCCMPKR")
#pragma linkage(CalculateDESMAC, OS)
#pragma linkage(CompWorkingKey, OS)
....
void CompWorkingKey(u_char *, u_char *, u_char *);
....
CompWorkingKey(flag, EDC_NO, WorkingKey);
....
12.OpCodes may be useful: Leave, Iter, LeaveSr
13.When used 'Update' operator to update a record, the record lock has been released.
14.It doesn't allowed to 'Read' on WorkStn File ,but chain/readc using @RecNbr Key.
15.SortA before Lookuping in an array.
16.Restriction: 65,535 positions for named data structures, 9,999,999 for unnamed data structures