Return to the RPG Tips
Use QWCRSVAL API to get the serial number
D QWCRSVAL PR ExtPgm('QWCRSVAL') D p_Rcvr Like(w_Rcvr) D p_RcvrLngth Like(w_RcvrLngth) D p_NbrToRtv Like(w_NbrToRtv) D p_SysVal Like(w_SysVal) D p_Error Like(DS_APIError) ************************************************************************ ** * #RtvSrlNbr - Retrieve the system Serial Number * ************************************************************************ ** P #RtvSrlNbr B Export D PI 8a * Work Fields used by Procedure D w_SrlNbr S 8 D w_Rcvr S 36a D w_RcvrLngth S 10i 0 inz(%len(w_Rcvr)) D w_NbrToRtv S 10i 0 inz(1) D w_SysVal S 10a inz('QSRLNBR') * Prototypes for calls D QWCRSVAL PR ExtPgm('QWCRSVAL') D p_Rcvr Like(w_Rcvr) D p_RcvrLngth Like(w_RcvrLngth) D p_NbrToRtv Like(w_NbrToRtv) D p_SysVal Like(w_SysVal) D p_Error Like(DS_APIError) D DS_SysValTbl DS D d_ValsRtn 10i 0 D d_Offset 10i 0 D D_Align 4a D d_SysVal 10a D d_ValType 1a D d_InfoSts 1a D d_DtaLngth 10i 0 D d_Data 10a C Reset DS_APIError C CallP QWCRSVAL(w_Rcvr : C w_RcvrLngth : C w_NbrToRtv : C w_SysVal : C DS_APIError ) C Eval DS_SysValTbl = w_Rcvr C Eval w_SrlNbr = %subst(d_Data:1:d_DtaLngth) C Return w_SrlNbr P #RtvSrlNbr E
[report a broken link by clicking here]