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



Thanks a million for your help. I hadn't remembered all the permutations
of parameter options, and was getting a little desperate to complete
this thing.

I had separate parameters for the path and file as we have many
environments and the folder structure is based on the environment
structure where each environment has a different data library. 

The application obtains the path name from a reference table.

By keeping the values separate I thought that the procedure would be
more flexible, and the concatenation of the two strings might be done at
a higher level rather than having each program do that prior to the
procedure call.

The third parameter was a direct copy from Scott's book on page 4. I
agree it should have been changed to the meaningful names as was done in
later examples, but it was one more small thing that needed to wait
until I finish this thing.

Obviously I got into trouble with variable length strings. Again I've
learnt a bit more. The problem with forums is that the price of getting
an insight is that one's ignorance has to be exposed. A small cost.

I actually solved the problem by allocating some memory, creating a
pointer, and using the %str function:

d pfname          s               *    
d flrlen          s             10i 0  
                  :
                  :
            alloc     256           pfname                   
            eval      docID=  %trim(FlrPth) + %trim(DocNam)  
            eval      flrlen= %checkr(' ':docid)+1           
            eval      %str(pfname:flrlen)= docid             

Probably ugly, but it worked. 
I agree that the parameter declarations as provided are more elegant. 

So everything is working except for the CCSID. 

When I look at the file created in the IFS, it has the CCSID value of
819 and it looks fine when opened via WRKLNK. However when I open it via
Windows Explorer it looks like and EBCDIIC file (gobbledy-gook all over
the place).

GOOGLING doesn't seem to provide any references other than one which
said that he opened, then closed then re-opened the file.
  
Any hints?

I would like to stress how grateful I am to people like Scott who have
done more to promulgate iSeries accessibility than IBM have ever done
with their sermons from the mount.

No criticism was meant either explicitly or implicitly.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Saturday, 15 July 2006 3:08 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Passing a path name through C open function.


I agree with all of Scott's advice.  However, if you happen to be at
v5r4, then you can use the following instead:

  d crtXMLDoc       PI             1N
  d  FlrPth                         *   value options(*string:*trim)
  d  ErrId                              like(ref.msgid)

I forgot about that... thanks for pointing it out.  However, 
options(*trim) was first available in V5R3 (one release earlier than
V5R4)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.