Input/Output parameter in quote rcmd command

Using FTP and QUOTE RCMD, does anyone know of a way to create an input variable? This variable would be used to call and execute an IBM Supplied API on a remote As/400 system.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Barry HarperConsultantCommented:
In the past, I have used an RPG program (sample source below) to create the FTP input script on the fly in a source file; it could be changed to do what you want.
Alternatively, look at the Run Remote Command (RUNRMTCMD) command to run your API on the target server, or perhaps use data queues to pass messages, such as run API and successful completion, back and forth.


FMFTPIN  O   E           K        DISK                        
F            MFTPIN                            KRENAMEFTPFM   
I              'NAMEFMT 1'           C         NAMEF          
I              'ANONYMOUS'           C         ANON           
C           *ENTRY    PLIST                                   
C                     PARM           @IPADR 15                
C                     PARM           @USER  10                
C                     PARM           @PWD   10                
C                     PARM           @FRMS  30                
C                     PARM           @FRMT  30                
C*  WRITE OUT THE USER                                        
C                     MOVE *BLANKS   SRCDTA                   
C           @USER     IFEQ *BLANKS                            
C                     MOVELANON      @USER                    
C                     END                                     
C           'USER'    CAT  @USER:1   SRCDTA                   
C                     WRITEFTPFM                              
C*  WRITE OUT THE NAME FORMAT COMMAND                         
C                     MOVE *BLANKS   SRCDTA                   
C                     MOVELNAMEF     SRCDTA          
C                     WRITEFTPFM                     
C*  WRITE OUT THE BINARY COMMAND                     
C                     MOVE *BLANKS   SRCDTA          
C                     MOVEL'BIN '    SRCDTA          
C                     WRITEFTPFM                     
C*  WRITE OUT THE PUT COMMAND                        
C                     MOVE *BLANKS   SRCDTA          
C           'MPUT'    CAT  @FRMS:1   SRCDTA          
C           SRCDTA    CAT  @FRMT:1   SRCDTA          
C                     WRITEFTPFM                     
C                     SETON                     LR   
C                     RETRN                          

Open in new window

Gary PattersonVP Technology / Senior Consultant Commented:
IBM supplies the following program for automating FTP:

You can generate the FTPCMDS file dynamically, and populate it with anything you like, including variable parameter values.
It would be much easier t try to answer if we had a couple examples of what the RCMD could look like. It's clear how a "variable" could make any difference to what you might be trying to do. Can you clarify some?
MichaelAuthor Commented:
Thanks for all your input.   Found an article from the Midrange magazine that provides me the needed results from a called CL program approach, versus trying to call the API directly from the QUOTE RCMD function.  Grabbing the FTP server (client session) job log to a file, DSPJOBLOG OUTPUT(*FILE) FILE(QTEMP/APICALLOG) and pulling that file back to the client with a GET for reviewing from my controlling host program.

Thanks again for your input.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MichaelAuthor Commented:
I did not need helping building the FTP QUOTE RCMD commands.  I needed help getting feedback from trying to run an API using QUOTE RCMD function.  Actually the API requires an INPUT/OUTPUT variable to be passed to it, which cannot be generated or defined in an FTP session.  So _b_h suggested help me change my search specs, and found the magazine article.  So the pointer from the MIDRANGE magazine about grabbing the FTP server (client session) job log, gave me the ability to use a CL Procedure / Program in the QUOTE RCMD, and get the success or failure details from the job log.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Mainframe OS

From novice to tech pro — start learning today.