In ILE, one ILE language can call procedures from any other ILE
language. It's one of the advantages of the ILE environment. In this
case, you'd like to work in CL, and assuming that ILE CL is acceptable,
that means that you can call procedures in another ILE language. Parts
of the operating system are written in C, so the C functions are always
available. You could write your program as follows:
DOFOR VAR(&FILENO) FROM(1) TO(350)
CALLPRC PRC('sprintf') PARM(&TEMP 'XREF%-6d' +
(&FILENO *BYVAL))
CHGVAR VAR(&FILENAME) VALUE(%SST(&TEMP 1 10))
/* at this point, &FILENAME='XREF1' or 'XREF2', etc */
ENDDO
ENDPGM
The first time through the loop, &FILENAME will be 'XREF1 '
the second time through it'll be 'XREF2 ', and so on until
you have 'XREF350 '.
Since this is ILE CL, the source member type should be CLLE (not CLP)
and since you need to use a routine from the ILE C runtime library,
you should compile the preceding program as follows:
This mailing list archive is Copyright 1997-2025 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.