Creating directories - BSNF for iSeries

Gustavo Barizon

Gustavo Barizon

Active Member

I need to create directories in a shared location from an UBE running on AS/400 - iSeries.

I'm trying to use the API function jdeMkdir, but no success at all. The permissions are set to full control to the "public" in iNavigator and once I create the directory manually, I'm able to write files in there, so there's no permissions issues.

Here's a snippet in how I'm implementing the directory creation:

#elif defined JDENV_AS400
mode_t mode = S_IRUSR | S_IWUSR | S_IXUSR;

nReturn = jdeMkdir(lpDS->szTextDirectory, mode);
if (nReturn != 0)lpDS->cReturnCode=_J('2');else lpDS->cReturnCode=_J('1');


My lpDS is defined as:
JCHAR szTextDirectory[255];

Any help is really appreciated.

- Gustavo Barizon
A couple of things:
1) what do you mean by 'shared location'? Is this an iSeries shared folder? Or is this a global network folder that can be seen from both iSeries and Windows?
2) what does your lpDS->szTextDirectory look like? Are you using forward or backward slashes?
3) permissions when running a UBE on a server are obtained from the JDE system user, not your individual user id. So just because your user has access to the folder doesn't necessary mean the UBE does

Suggestion: whenever I have to deal with iSeries and shared folders, I push to use QNTC. There is setup involved, but most likely your iSeries is already running it. I am not the person who can tell you how that works. From an E1 standpoint, your E1 system user must have a domain account with the exact same user and password as that of the iSeries. Once that and QNTC are all setup, you should be able to access any folder on your domain from your iSeries using the following nomenclature: /QNTC/<servername>/<network share>/<folder>/...