|
varner=vwZBVSELaea5SvY1vBzdmdi2O/JbrIOy@public.gmane.org wrote:
I need to retrieve the last 32000 characters from a null-terminated string. According to IBM this can only be done using a C language program. I don't know C. Does anyone have any examples or suggestions?
Assuming you have a pointer to the data, you can manually search for the X'00' character at the end of the string, then subtract 32000 to point to the beginning of the data you're interested in. The following program illustrates (but pointing to the last 10 chars): ------------------------------------------------------------- H dftactgrp(*no) D area s 10a based(p) D bch s 1a based(p) D len s 10i 0 D long s 65535a inz(*all'jdshfgjhdf') /free %subst(long:%size(long):1) = x'00'; p = %addr(long); dow bch <> x'00'; p = p + 1; enddo; p = p - 10; dsply area; *inlr = *on; /end-free ------------------------------------------------------------- Cheers! Hans
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.