× 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.



I was using ASCII control characters as an example. Windows text editors typically look for the combination of CR and LF characters to break a new line, whereas many Unix environments will recognize just the LF character.
Try to insert both characters into your print stream and see how the Windows text editor handles it.

Jason Abreu
Abreu Innovations, Inc.
jason.abreu@xxxxxxxxxxxxxxxxxxxx
http://www.abreuinnovations.com/

On 3/9/2011 3:41 PM, Mark S. Waterbury wrote:
Oh, wow ... I thought this was going to be about Logical Files ... *:-/*

> On 3/9/2011 3:32 PM, Dennis wrote:
I thought I had solved this problem ages ago... Here goes.

I have an ILE C program that I run from QSH via soft-link created a la:
ln -fs /qsys.lib/mylib.lib/mypgm.pgm /home/thisguy/bin/myprogram

Program looks like this:
#include<stdio.h>
int main(int argc, char **argv) {
printf("Hello, world.\n") ;
printf("Hello, world.\n") ;
printf("You still here?\n!) ;
return 0 ;
}

(Exciting, I know.)

I can run this, and the output looks fine. I can also pipe my output
to a file (myprogram> /tmp/myfile.txt) and when I cat /tmp/myfile.txt,
everything looks fine.

But it is not. The "new line" character has been translated to 0x85
(or x'85' if you prefer). Job CCSID is 37. Shell created the file as
CCSID 819. WRKENVVAR shows QIBM_CCSID = 819.

The reason I noticed this is that I sent a file like this to a Windows
system using ASCII mode, and the Windows system shows no LF (of
course), and instead views it as one streamed line.

What would be the appropriate CCSID for me to use for such an
operation? Following on to that, should I (not) be able to specify one
CCSID for most purposes and be done with it (assuming I'm only using
IBM i, Windows and Linux systems in US English)? Or is CCSID even the
problem?!?! Maybe I should be using something other than "...\n" in my
printf() ?

--
Sent from my Galaxy tablet phone with with K-9 Mail. Please excuse my
brevity.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.