I removed the Binary cause I know it makes some of ya MAD!
Code:
dQWCRDRTN DS d QWCBAVL 10i 0 Qwc Rdtaa Data d QWCBRTN 10i 0 Bytes Available d QWCTVRTN 10 Bytes Returned d QWCLIBN 10 Type Value Return d QWCLVRTN 10i 0 Library Name d QWCNBRDP 10i 0 Length returned d QWCVALUE 475 Number Decimal // // // dQUSEC DS d QUSBPRV 10i 0 d QUSBAVL 10i 0 d QUSEI 7 d QUSERVED 1 d QUSED01 1 drcvvarsiz s 10i 0 inz(512) ddtaaraname s 20 inz('IN1BSIN LBIFIL ') dstrpos s 10i 0 inz(-1) dstrlen s 10i 0 inz(475) // // Required Parameter Group: // // 1 Receiver variable Output Char(*) // 2 Length of receiver variable Input Binary(4) // 3 Qualified data area name Input Char(20) // 4 Starting position Input Binary(4) // 5 Length of data Input Binary(4) // 6 Error code I/O Char(*) // d $getdataarea pr extpgm('QWCRDTAA') d recieveVar 475 d lengthRecvar 10i 0 d dataareaLib 20 d startpositon 10i 0 d lengthofInp 10i 0 d errorcode 17 // // run the api and retrieve the data // this is useful if you have same dataarea in *multiple // libraries and need info from them all via RPG. // just change the data in "dtaaraname" and rerun for // other library/dataarea's // /free QUSBPRV = 0; $getdataarea(QWCRDRTN : rcvvarsiz : dtaaraname : strpos : strlen : QUSEC ); // The variable QWCVALUE now contains the *DTAARA value dsply %subst(QWCVALUE:1:30) ' '; *inlr = *on; /end-free
Comment