upload to as/400

55 pts.
Tags:
AS/400 FTP
CL
Client Access
hi, my user can only use client access to upload and download file only (please assume there is only this method), is it possible for me to write a batch file to automate the upload and download. just like ftp, i can always write a script to put all the 'GET' command and trigger the FTP in CLP program. please advise. thanks

Answer Wiki

Thanks. We'll let you know when a new response is added.

if you have a transfer created to upload or download this can be modified to go run the transfer or change the transfer name in the &strcmd on the fly and do multiple transfers. We use something similar to this with menu options to allow user to download and view/modify in Excel and/or Word and then upload modified data back to 400. I use a version to upload 7 text files and then run a program against them to create a file that gets updated only if the text files have a new creation date.
Remember , this will need be modified to your current needs.

<pre>
PGM
/* clle must be run on PC where everything is located. */
/* create directory called download on PC or specify your directory of choice. We use DOWNLOAD as a defaule so we will always know where to look for transfer STUFF */
/* create transfer to download EXCEL file to directory on PC */
DCL VAR(&STRCMD) TYPE(*CHAR) LEN(55) +
VALUE(‘C:\DOWNLOAD\EXCELFROM.DTF’)
/* or *.tto */
DCL VAR(&PCCMD) TYPE(*CHAR) LEN(55)
/* run the transfer */
STRPCO PCTA(*NO)
MONMSG MSGID(IWS4010)
STRPCCMD PCCMD(&STRCMD) PAUSE(*NO)
/*the transfer is done at this point – now */
/* if necessary change the transfer name and repeat the code.

/* open the EXCEL file on the PC. if needed */
STRPCO PCTA(*NO)
MONMSG MSGID(IWS4010)
STRPCCMD PCCMD(‘START C:\DOWNLOAD\EXCElTEST.xls’) +
PAUSE(*NO)
ENDPGM
</pre>
Hope this helps
BigMac

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
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
  • Mid11
    with client access you can use the batch transfer programs rtopcb and rfrompcb in a dos bat file. First, create/save file transfer request. Then call it from a batch file. ie rtopcb "c:night jobswebwebparts.dtf" use the /? switch for more parameters.
    80 pointsBadges:
    report
  • Bigmac46
    sample of CLLE used to run a DOS batch file to do multiple transfers
                 PGM                                                        
                 DCL        VAR(&STRCMD) TYPE(*CHAR) LEN(55) +              
                              VALUE('C:DOWNLOADtransfer.bat')              
                 DCL        VAR(&PCCMD) TYPE(*CHAR) LEN(55)                 
                 STRPCO     PCTA(*NO)                                
                 MONMSG     MSGID(IWS4010)                           
                 STRPCCMD   PCCMD(&STRCMD) PAUSE(*NO)                
                ENDPGM 
    
    transfer.bat contains RFROMPC /F C:downloadtransfers.txt transfers.txt contains C:downloadstransfer1.TFR C:downloadstransfer2.TFR C:downloadstransfer3.TFR C:downloadstransfer4.TFR C:downloadstransfer5.TFR C:downloadstransfer6.TFR C:downloadstransfer7.TFR call the CLLE from anywhere you can call it (menu/rpg pgm/ clle pgm) I do believe this set up needs to interactive to work.
    1,000 pointsBadges:
    report
  • Bigmac46
    should be DOWNLOAD transfer.bat and downloadtransfers all occurences
    1,000 pointsBadges:
    report
  • Bigmac46
    it is being left out on the screen but a BACKSLASH should be after the word download and downloads should be download(backslash. Also the C: backslash is missing.
    1,000 pointsBadges:
    report
  • PSMurray
    Boulevard - Here is a good explanation: http://www-03.ibm.com/systems/resources/systems_i_software_access_pdf_dataxfer.pdf Phil
    530 pointsBadges:
    report
  • PSMurray
    ARG! http://www-03.ibm.com/systems/resources/systems_i_software_access_pdf_dataxfer.pdf
    530 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

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

REGISTER or login:

Forgot Password?
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

Thanks! We'll email you when relevant content is added and updated.

Following