I have an RPGLE program and was wanting to use the QXXCHGDA in it. No matter what I try however, I keep getting error "CPF1088 - Starting position outside of data area." I have no idea what I'm doing wrong on this. My test DTAARA is a character DTAARA, 10 characters long. My test code is:
Changing the size of NewData to match the DTAARA size makes no difference (though I didn't think it would) though I don't want to do that as eventually it should be able to updated others with different lengths. Any help appreciated.
Code:
D ChgDtaAra PR ExtPgm('QXXCHGDA') D prQualDtaAra LikeDS(qualdtaara) Const D prStart Like(startpos) D prLength Like(length) D prNewData * D QualDtaAra DS Qualified D Name 10a Inz('TESTARA') D Library 10a Inz('TESTLIB') D StartPos S 5i 0 Inz(1) D Length S 5i 0 Inz(4) D ptrNewData S * Inz(%Addr(newdata)) D NewData S 2000a Inz('Test') ************************************************************************************ /FREE ChgDtaAra(qualdtaara : startpos : length : ptrnewdata); *INLR = *ON; /END-FREE
Comment