How To
Summary
This technote describes a method to automate data transfers to and from a client PC without having to store an ID and password in a script.
Objective
You need to transfer data to and from a client on a regular basis. The data transfers are using IBM i Access Client Solutions data transfer requests that are stored in a directory on a Windows PC that also contains the PC data files. One option is to set up a script file on the client that makes use of the logon and transfer plug-ins and run that script using the Windows task scheduler or something like cron on a Linux or Mac setup. The problem with that approach is that the logon plugin requires that you provide a password so it has to be run interactively so that a user can enter it or the password has to be stored in clear text in your script file. That first option can't be done in Windows task scheduler, it starts tasks in a session that doesn't have a desktop or user. The latter option is a security risk. What can you do? The following is one possible solution that doesn't require an investment in any third-party tools; instead, it leverages functionality you already have, CIFS clients and servers built in to your OS's, the IBM i job scheduler, and the IBM i Toolbox for Java's authentication feature for local JVMs.
Steps
Share the file location.
For this example, assume your workstation is a Windows PC. MAC and Linux have CIFS/Samba clients and servers as well and could be used in a similar fashion, only this step would changed based on how the CIFS/Samba product works.On the PC side you need to share the directory in which the data transfer requests and data files reside. In my example that directory is C:\Users\Public\Documents\InvoiceData on a Windows server named WINSERV. Open that path in the Windows file explorer, right-click the InvoiceData directory and select 'Properties'. In the Properties window click the 'Sharing' tab and click either the 'Share...' button or 'Advanced Sharing' button. The difference is that you can define permissions with the advanced option. I used the Advanced sharing option, defined that share name to be 'InvoiceData' and gave the 'Everyone' group all access to the folder. Note that these are Windows permissions so the IDs that you can authorize are Windows IDs.
Once the path is shared, I can confirm it is shared and visible by running the following command from a Windows command prompt: net view \127.0.0.1- Test QNTC access to the share.
In step one you created a file share in the Microsoft CIFS server. To use the IBM i CIFS client to access that share, you must be able to authenticate to the Windows system from IBM i. This can be done with Kerberos if you have single signon configured or with IDs and encrypted passwords. Setting up Kerberos is beyond the scope of this document. This technote describes what needs to be done to make encrypted passwords work: ID and Password Considerations for QNTC File System .
For this task, we could create a new ID on Windows and a matching profile in IBM i that are only used for this purpose. It could be set up with the authority to read the files for the downloads and change the files for the uploads. The password is set to match the Windows password, the password expiration set to NONE. Once testing it complete the profile can be further restricted by setting the initial menu to *SIGNOFF so that it cannot be used interactively.
To test out the QNTC connection, sign on to an IBM i emulation session with the ID and run the following commands. First define your Windows server to the QNTC client with a make directory command. In my example the server is named WINSERV: md '/QNTC/WINSERV'. Next make sure that the ID can connect to the server and view the shares: wrklnk '/qntc/winserv/*' If you don't see any shares listed, check your job log, there is likely an authentication or name resolution failure to be resolved. If you are getting authentication failures, recheck the technote ID and Password Considerations for QNTC File System. In the path /qntc/winserv/invoicedata I see the following files:
project.csv
project.dtfx
DailySales.csv
DailySales.dttx
DailySales.fdfx
These will be used for the download and upload. - Modify the transfer requests.
The transfer requests saved on the PC are using paths that are defined on the PC. For example the project.dtfx request is defined to create or replace a file named project.csv in the path C:\Users\Public\Documents\InvoiceData\. That will not work when the transfer request is run on the IBM i; it has no C: drive. So the paths have to be modified in the requests to replace the path C:\Users\Public\Documents\InvoiceData\ with /QNTC/WINSERV/InvoiceData/. This change can be done by opening the transfer requests in the GUI interface and modifying them or simply open the .dtfx and .dttx files in a text editor and do a global find and replace. Create a transfer script.
Create a simple CL program with the steps to confirm that the CIFS server path is defined, run the download to the PC and the upload from the PC and then kill the ACS java daemon job that would normally keep running. My CL program source looks like this:PGM MD '/QNTC/WINSERV' MONMSG MSGID(CPFA0A0) /* Object already exists...ignore */ JAVA CLASS('/QIBM/ProdData/Access/ACS/Base/acsbundle.jar') PARM('/PLUGIN=DOWNLOAD' + '/QNTC/WINSERV/InvoiceData/Project.dtfx') OUTPUT(*PRINT) JAVA CLASS('/QIBM/ProdData/Access/ACS/Base/acsbundle.jar') PARM('/PLUGIN=UPLOAD' + '/QNTC/WINSERV/InvoiceData/DailySales.dttx') OUTPUT(*PRINT) JAVA CLASS('/QIBM/ProdData/Access/ACS/Base/acsbundle.jar') PARM('/PLUGIN=MAINT' + '/KILLDAEMON') OUTPUT(*PRINT) ENDPGM- Schedule the transfer to run.
Once created, the program can be tested interactively by calling it with your user ID that can use the QNTC path. Once any problems are sorted out, you are ready to add a job scheduler entry to submit this job to run. In this example I have it run every Monday at 5 AM using the ID created just for this purpose, INVOICEGUY.
QSYS/ADDJOBSCDE JOB(INVOICEXFR) CMD(SBMJOB CMD(CALL PGM(INVOICES/INVOICEXFR)) JOB(INVOICEXFR) USER(INVOICEGUY)) FRQ(*WEEKLY) SCDDATE(*NONE) SCDDAY(*MON) SCDTIME('05:00:00')
Related Information
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
27 March 2026
UID
ibm17267931