× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 31-Oct-2011 12:09 , James Lampert wrote:
Is there some quick and easy way, under V6R1, to take EBCDIC text
passed as a parameter to a CL program, and make an ASCII stream file
from it?


A CLP as an example that might fit:

<code>

pgm parm(&inpstr)
dcl &inpstr *char 30
dcl &qshrqs *char 2000
dcl &outnam *char 30 'output.txt'
chgvar &qshrqs 'touch -C 819 '
chgvar &qshrqs (&qshrqs *bcat &outnam *tcat ';')
chgvar &qshrqs (&qshrqs *tcat 'echo "')
chgvar &qshrqs (&qshrqs *tcat &inpstr )
chgvar &qshrqs (&qshrqs *tcat '" > ' *bcat &outnam)
sndpgmmsg msg(&qshrqs) topgmq(*ext) tomsgq(*topgmq)
qsh cmd(&qshrqs)
endpgm

/* invocation example, input, final string, and outputs; */
/* final string on QSH shows how the ASCII stream file */
/* is created and how the parm data is output to an STMF */

CHGJOB CCSID(37) /* CCSID of input string is 37 */
CALL PGM(abovepgm) PARM('This is echoed.')
1000 - SNDPGMMSG MSG('touch -C 819 output.txt;echo "This is echoed." > output.txt') TOPGMQ(*EXT) TOMSGQ(*TOPGMQ)
touch -C 819 output.txt;echo "This is echoed." > output.txt
1100 - QSH CMD('touch -C 819 output.txt;echo "This is echoed." > output.txt')

DSPF output.txt /* F10=show hex: */
- - - - + - - - - * - - - - + - - - - * ----+----*----+----*
54686973 20697320 6563686F 65642E0A This is echoed.

</code>

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.