× 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 08/07/2004, at 4:39 AM, jared wrote:

I uploaded my source files via ftp to a subdirectory of /QOpensys, so
they're stream files. After editing the files to make sure none of their
lines exceeded 80 chars, I used CPYFRMSTMF to copy one of them to the
source member of a native library. The source code in the native library
member #includes a header file that currently only exists as a STMF, in
another IFS directory outside of /QOpensys.

a) You can compile directly from the stream source.
b) Traditional source files can be longer than 80 bytes. 240 is the maximum the SEU will support but the compiler will handle source as wide as 32,754 columns.
c) Probably not a good idea to have some source in traditional files and some in stream files although symbolic links can be used to make traditional source files look like stream files.


In QShell (green-screen qsh), I can invoke ixlc on the main C file under
/QOpensys, and it spits out a bunch of compile errors related to the
header file it wants to include. No surprise. When I specify the other
include directory using ixlc sourcefile.c -I/blah/version/include, I no
longer get the compile errors, but I get a message saying the program was
not created because the compile failed, and no additional information.

Puke! Forget qsh. That and PASE are simply crutches so Unix dweebs don't have to learn anything about OS/400. Use the native compilers and specify OUTPUT(*PRINT) so you get a compiler listing. (I never understood why the C compiler default is to not print a compiler listing. Doh!)


Note: You can force ixlc to print a compiler listing by specifying -qprint or use -qoutput-"filename" to redirect the compiler output to a file.

You'll probably find that the compiler error messages were actually sent to the joblog of the job running the compiler. In this case that is likely the shell BCI job and not your interactive job.

Back in the native environment, I can submit a job calling CRTBNDC on the
native library copy of the main source file, but I've been totally unable
to get CRTBNDC to find the STMF format header files. I tried specifying
the path to the header inside the main source file, and specifying the
include directory via the INCDIR('/blah/version/include') parameter to
CRTBNDC, and get identical job output. According to the compiler
reference, I can call CRTBNDC or CRTCMOD on a STMF file, but if I do so
the INCDIR parameter will be ignored.

I think you cannot mix-n-match source primarily because the search rules for locating included source are different. Source must either be in traditional source files or in stream files. The only exception is when a symbolic link maps traditional source members as stream files. This is how IBM make the QSYSINC header files (in traditional source members) available to stream file source.


I think the documentation is wrong. The SRCSTMF keyword says that INCDIR is ignored but INCDIR says it is valid only if SRCSTMF is specified. Your results would fit with INCDIR being ignored when the SRCF parameter is specified.

You can also specify the include path in INCLUDE environment variable.

Clearly I'm missing something crucial. Do I have to allocate a file
to hold the program output from ixlc, and explicitly tell the compiler
where to go looking for it? On the CRTBNDC side, is it even possible to
point to STMF headers in source code compiled from native library members?

Don't know. I refuse to use the shell rubbish for more than trivial tasks. If it can't be done natively then I won't do it.


On the native side just set the INCLUDE environment variable and compile your source directly from the stream files. It would seem reasonable to me that if you have stream file headers then you ought to have stream file source.

Looking forward to larger ports, how can I copy from stream files without
truncating the lines?

a) Compile directly from stream files b) CRTSRCPF xxxxx RCDLEN(240) or larger

Any help is of course much appreciated-

Did it help?

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists

   http://www.flybynight.com.au/
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175                                   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



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.