因为as400上QCMDEXC命令大家已经很熟悉了。。现在使用一个和QCMDEXC功能相等的命令,只是这个命令执行后能得到执行结果,所以有时可能也得用到。该命令是QCAPCMD,例子如下:
RPGLE:
fnewfile if e k disk usropn
dcommand s 40 inz(' ')
dcmdlng s 10i 0 inz(40)
docb ds
d type 10i 0 inz(0)
d DBCSdh 1 inz('0')
d prompt 1 inz('0')
d cmdsyntax 1 inz('0')
d msgrtvkey 4 inz(x'00000000')
d reserve1 9 inz(x'000000000000000000')
docblength 10i 0 inz(x'00000014')
docbfmt 8 inz('CPOP0100')
dchgcmd 1 inz(' ')
dlngchgcmd 10i 0 inz(0)
dlngchgrtn 10i 0 inz(0)
d/COPY QSYSINC/QRPGleSRC,QUSEC
d qused01 17 116
c eval command = 'OVRDBF NEWFILE SHARE(*YES)'
c Z-ADD 116 QUSBprv
c call 'QCAPCMD'
c parm command
c parm cmdlng
c parm ocb
c parm ocblength
c parm ocbfmt
c parm chgcmd
c parm lngchgcmd
c parm lngchgrtn
c parm QUSEC
c QUSBavl ifgt 0
c 'Error on API'DSPLY
c qusei dsply
c end
c open newfile
c *loval setll fmt1
c read fmt1 30
c *in30 ifeq '0'
c fld1 dsply
c else
c 'No Records' dsply
c end
c close newfile
c eval *INLR = '1'
DDS for newfile:
R FMT1
FLD1 10
FLD2 10
K FLD1
阅读(1264) | 评论(0) | 转发(0) |