创建CrtUsrSpc procedure,原型直接指针输出,通过QUSCRTUS,QUSPTRUS,QUSCUSAT
h nomain
dCrtUsrSpc pr * extproc('CrtUsrSpc')
d SpcName 20 const
pCrtUsrSpc b export
dCrtUsrSpc pi *
d SpcName 20 const
dCrtSpc pr extpgm('QUSCRTUS')
d SpcName 20 const
d SpcAttr 10 const
d SpcSiz 10i 0 const
d SpcVal 1 const
d SpcAut 10 const
d SpcTxt 50 const
d SpcRpl 10 const options(*nopass)
d ErrCde likeds(ErrCde) options(*nopass)
d SpcDmn 10 const options(*nopass)
d SpcTfrSiz 10i 0 const options(*nopass)
d SpcSpcAln 1 const options(*nopass)
dRtvSpcPtr pr extpgm('QUSPTRUS')
d SpcName 20 const
d UsrSpcPtr *
d ErrCde likeds(ErrCde) options(*nopass)
dChgSpcAtr pr extpgm('QUSCUSAT')
d SpcLib 10
d SpcName 20 const
d ChgAttrDS const likeds(ChgAttrDS)
d ErrCde likeds(ErrCde)
dChgAttrDS ds
d NbrAttrs 10i 0 inz(1)
d KeyValue 10i 0 inz(3)
d DataSize 10i 0 inz(1)
d DataValue 1 inz('1')
dErrCde ds
d BytPrv 10i 0 inz(0)
dUsrSpcPtr s *
dSpcLib s 10
/free
// Create the user space
CrtSpc( SpcName :' ' :1 :x'00' :'*CHANGE' :' ' :'*YES' :ErrCde);
// Get a pointer to the user space
RtvSpcPtr( SpcName :UsrSpcPtr :ErrCde);
// Change the user space to be automatically extendable
ChgSpcAtr( SpcLib :SpcName :ChgAttrDS :ErrCde);
Return UsrSpcPtr;
/end-free
pCrtUsrSpc e
阅读(2506) | 评论(0) | 转发(0) |