By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your response...

Discuss This Question: 9 &nbspReplies

There was an error processing your information. Please try again later.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Please run DSPCMD FTP and post the "Where allowed to run" section here. You don't show us the i5/OS version you're running, so I can't tell if you'll run into a command proxy chain. If you do, then run DSPCMD <proxyLib>/FTP instead.
It's possible that your FTP command allows execution in a program in batch but not as a batch command.
Also, I wouldn't run the OVRDBF commands separately from the FTP command. There's no guarantee that they'll run in the same job nor that the override will still be in effect when the FTP command runs. Both should be in a program together.
And AFAIK, the FTP command is not threadsafe up through at least V7R1. You might run into unpredictable results trying to run it this way.
Tom

Current proxy chain . . . . . . . . . : QSYS/FTP
QTCP/FTP
On V5R4 and later, commands can be "proxies" instead of being "duplicates". That is, you can copy a command with CRTPRXCMD instead of with CRTDUPOBJ. A proxy command is more like a symbolic link back to the original command than a new object that is a copy of the old one.
The 'Current proxy chain' above shows that the real FTP command is in QTCP, not QSYS. So you run DSPCMD QTCP/FTP to locate the “Where allowed to run” section.
There seem to be two likely possibilities. First, the “Where allowed to run” attribute allows your FTP command to be run in batch if it's in a program. Second, the OVRDBFs are not in effect when the FTP runs, so it tries to communicate with a terminal session.
Other possibilities might exist, but we should try to make sure that those two are eliminated before digging deeper.
And just in case, you probably should run WRKOBJ *ALL/FTP just to make certain that no other versions of the command exist in any other libraries.
Tom

If there are no other FTP commands on the system, then the first possibility to handle is that the overrides are not in effect. The OVRDBF and FTP commands should be codded into a CL program. Then the program can be called through QCMDEXC.
If that is successful, then the problem is probably confirmed to be with the overrides. If it is not successful, then the CL program should posted here along with the joblog that shows the running of the program. You include a DSPJOBLOG command after the FTP command in the CL program to ensure that a joblog is spooled.
If the FTP fails and causes the program to fail before the DSPJOG command can run, you should include a MONMSG for the FTP error to make certain that the program continues.
Tom

Tom, we've got FTP running from inside an RPG/ILE program - the OVRDBF commands and the FTP command being executed using the QCAPCMD API. The override scope is *CALLLVL, but that's about the only thing slightly out of the ordinary.

we’ve got FTP running from inside an RPG/ILE program
That should be fine because the RPG program is guaranteed to execute the overrides and the FTP command in the same job. But PHP will be interpreted. I don't currently have a PHP setup to test, so I can't tell if the calls to QCMDEXC will always be executed in the same job or if they'll be handed off to different BCI jobs or if they'll be executed in different threads or what.
The CPD0772 error suggests that the FTP is being run as an *INTERACTIVE command, which suggests that FTP is trying to open a terminal session for the input script and for any output. The OVRDBFs look okay (though I can't tell because I don't know if they're really valid on that system).
If you simply submit a FTP command by itself to batch, you should see the same CPD0772 error. The text of the message is probably a little misleading in this case, but the meaning is appropriate.
Execute the commands within a single compiled program, such as your RPG, and it should work.
Tom

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

Share this item with your network:

To follow this tag...

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy