RPG for AS/400 using skills

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
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值