Midrange News for the IBM i Community

Posted by: clbirk
how to access a remote IFS?
has no ratings.
Published: 27 Feb 2014
Revised: 03 Mar 2014 - 3729 days ago
Last viewed on: 17 May 2024 (6313 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

how to access a remote IFS? Published by: clbirk on 27 Feb 2014 view comments(4)

I am having a brain fart,  from ibmi #1 say on a 192.168.1.xxx subnet, I want to access the IFS on ibmi #2 on 192.168.12.xxx (there is a vpn there, and I do ddm all the time with other files) but how do map like say in a copytostmf command, the other IFS? 

I realize the folder I would want would need to be a shared folder?


Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Comment on: how to access a remote IFS?
Posted: 10 years 2 months 22 days 5 hours 2 minutes ago
Edited: Thu, 27 Feb, 2014 at 09:43:17 (3733 days ago)



For example, if you have my FTPFILE command or write your own FTP !--script--, you could do this:

FTPFILE RMTSYS(xx.xx.xx.xx)  PUTGET(*GET) LCLFILE(*STMF) LCLSTMF('/home/clbirk/data.csv') USER(clbirk) PWD(rosebud)

The FTP !--script-- should be easy enough if you don't want to use FTPFILE.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: how to access a remote IFS?
Posted: 10 years 2 months 22 days 3 hours 10 minutes ago

Or were you thinking like WRKLNK, CPYTOSTMF, open a *STMF in a program, that sort of thing? You can do that with /QNTC file system (http://pic.dhe.ibm.com/infocenter/iseries/v6r1m0/topic/ifs/rzaaxqntcfs.htm). Basically, you create a subdirectory of /QNTC with either a host name or dot address, as in:

CRTDIR '/QNTC/otherserver'
CRTDIR '/QNTC/192.168.12.xxx'

There are some security concerns (see the InfoCenter), but basically I think it boils down to that the user/password on the local system must also exist on the remote system, and I kind of think the password check is not case sensitive.

Anyway, once you add the directory to /QNTC, then you will see all of the exposed shares on the remote server as subdirectories of that. '/QNTC//192.168.12.xxx/share1', '/QNTC/192.168.12.xxx/share2', and so on. On i, those are shares you expose with NetServer. The remote server could also be non-i, Windows or something, but it works the same way.

Once you have the directory created, you can access anything in one of the shares pretty much like any other IFS file.

Thing to remember #1: /QNTC directories are lost when you IPL the server. You might want to put CRTDIR in your startup program. Or, you could have the application try to CRTDIR on the fly, and ignore the error if it already exists.

Thing to remember #2: If you try to WRKLNK '/QNTC', it will want to scan your network looking for all exposed shares. This can take a very long time. Look in the InfoCenter (above) in the environment variables section, and look at QIBM_ZLC_NO_BROWSE; this can disable the scanning, which means you only see directories that you've explicitly added with CRTDIR (or equivalent). Can save you a lot of time.

Posted by: clbirk
Premium member *
Comment on: how to access a remote IFS?
Posted: 10 years 2 months 21 days 3 hours 22 minutes ago

ftpfile sounds easier.


I use qntc stuff for windows/linux, I read online about using qfileserver.400 (there is an IT jungle paper I found on such).


Dale you said QNTC directories are lost when you IPL. I have a couple that I have had for at least a year, and I know that in that time frame I have IPL'ed (ptf's) and I didn't lose them, but I will watch for that.


Thanks to both of you for your comments.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: how to access a remote IFS?
Posted: 10 years 2 months 18 days 1 hours 43 minutes ago

Maybe I missed a change that happened at a certain release? I seem to remember losing /QNTC directories when we IPLed, and that was before we turned off auto-browse (the ENVVAR). In any case, if they now persist, that sounds like a good thing.