To be upfront, I've never actually needed to create a text file from a RPGLE program before, so I'm going off what I find on the web for most of it.
I have one statement that is totally stymieing me, and I'm not entirely sure why. (code to follow)
The first pair of writes to the file work perfectly, it's when I get to the third write that I have issues (the bolded section of code). It writes the first line fine, then after 32560-ish spaces writes the next line. If I add the term field to the back of the statement, it doesn't write at all. Thanks ahead of time for taking a look at it, I've been at it for 2 days and don't see the issue.
Andy
I have one statement that is totally stymieing me, and I'm not entirely sure why. (code to follow)
Code:
]d crlf c const(x'0d25') d term c const(x'00') d pathfile s 50 d openmode s 100 d fileptr s * d snddata s 32767a d i s 3p 0 * dopenfile pr * extproc('_C_IFS_fopen') d * value d * value * dwritefile pr 10i 0 extproc('_C_IFS_fputs') d * value options(*string) d * value * dclosefile pr extproc('_C_IFS_fclose') d * value options(*string) /free if rvr_hold = blank; rvr_hold = usr_array(y); snddata = 'Hi ' + %trim(%char(usr_array(y))) + ',' + crlf + term; writefile(%addr(snddata):fileptr); snddata = 'There are open tasks that require your review:' + crlf + term; writefile(%addr(snddata):fileptr); endif; [B]if rvr_hold = rvr_hold; snddata = %trim(ecr_array(y)) + ', ' + %trim(%char(seq_array(y))) + ' - ' + %trim(dsc_array(y)) + ' has ' + %trim(%char(cnt_array(y))) + ' tasks open assigned to '; if asn_array(y) = *blank; snddata = %trim(snddata) + ' no current assignee' + crlf; else; snddata = snddata + %trim(asn_array(y)) + crlf; endif; writefile(%addr(snddata):fileptr); [/B] else; ....
Andy
Comment