Create & Read Text file on AS/400

Chan Rana

Chan Rana

Legendary Poster
Hi All,
It has been long since i last worked on AS/400 need to refresh my skills now.
I am trying to read a (text)file (in UBE) created thru a source editor in AS400. Offcourse i am using FetchNextLine function.
I use path as Library/file name while opening the file. but i get error(3003) unable to open file. That said i need to know if this is correct way of making text file on AS/400 or there is other way to generate it manually so it can be read on AS/400.
I am not able to recall the correct way so any help is appreciated before i reinvent it.

Thanks,
Chan
8.12, TR 8.97 ,AS/400
 
Hi Chan,

Based on your release, I think you'll need to create the text file in the IFS structure on iSeries not in a library. It's a unix/dos/etc. like file system with directories. The cmd WRKLNK will get you into the root from a green screen. You can also use the GUI Navigator that comes with client access.

Access your file with the standard syntax \folder\file.txt with the flat file BSFNs.

Hope this helps,
Craig
 
Craig,
I will look into the IFS option but if i recall correctly i do use to read from the Library.

Thanks,
Chan
 
Craig,
Yes i found article on this in KG. earlier it was possible but now IFS seems the only options.

Thanks,
Chan
 
Yeah, I think it's based on where the source files are compiled (which moved a while back), or something like that. Anyway, if you have a database file, you can use CPYTOSTMF to move it to the IFS prior to processing.

Craig
 
I fought a similar issue, about five years ago, with an FTP Script builder. It will be Tuesday before I can be back at my 'archive' - if I can find the resolution, I'll update.

The Copy to streamfile is the cleaner solution. Then, ask yourself - what if you have to update the text?

I believe I had to use a Shell Command to read/write - it was a pure wave of Pixie Dust and Wand Magic when it finally worked.

(db)
 
Back
Top