Ability to perform AS/400 file transfers in batch

0 pts.
Tags:
AS/400
DataCenter
Development
Is there a way to perform AS/400 file transfers in bathc using client access? The STRPCCMD can only be run interactively, but I need a way to schedule a job to run daily which will transfer files from the AS/400 converting it to CSV format on a PC based server. I am open to any other ways to perform the file transfer if possible.
ASKED: June 9, 2005  9:02 AM
UPDATED: January 8, 2010  5:51 AM

Answer Wiki

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

STRPCCMD only interactive?
Check for STRPCO in this forum. (only CA)
Or you can run a RFROMPCB(RTOPCB) in a .bat file?

====================================================

There should be no need for STRPCCMD ever. The AS/400 and Windows/Linux PCs can share directories through Windows networking. you don’t need to transfer a file when a file can be directly accessed through a network shared directory. Just put your file into a shared IFS directory (possibly into a /QNTC directory) and the PC that needs it can just map a drive to the same directory. Or the PC can simply use a UNC path ( \\ComputerName\SharedFolder\Resource ) and not map a drive at all.

Also, note that RUNRMTCMD can execute remote commands on a PC that will accept remote commands. You can install the remote command service on a PC through System i Access Selective Setup. Create a local PC user that can act as the user for the commands.

Forget STRPCCMD (except in some very particular circumstances). It’s effectively obsolete and appropriate for DOS Client Access. You probably won’t ever use such a PC again. Learn the technologies that are appropriate today.

Tom

Discuss This Question: 4  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
  • DPSFizz
    You can also create a CL and run it in batch. Here are a couple of examples regarding CSV files using CPYTOIMPF (from www.as400pro.com): ======================== Converting EBCDIC to CSV Try using CPYTOIMPF to put in a folder. Something like CPYTOIMPF FROMFILE(YourLib/YourFile) + TOSTMF(/QDLS/YourFolder/YourPCDoc) + RCDDLM(*CRLF) + DTAFMT(*DLM) + STRDLM('"') + FLDDLM(',') + DECPNT(*PERIOD) This creates a CSV file in the folder. Then FTP this file. =============================== Copy a file to an CSV file CPYTOIMPF FROMFILE(STLIB/STATEP2) + TOSTMF('QDLS/TXT/STATEP2') RCDDLM(*CRLF) COPY OBJ('QDLS/TXT/STATEP2') + TOOBJ('QDLS/TXT/STATEP2.CSV') + TOCODEPAGE(*PCASCII) DTAFMT(*TEXT)
    0 pointsBadges:
    report
  • RonBender
    I agree with DPSFizz, to FTP the file but you can't get it in a CSV format on the PC server. Maybe if you FTP with the extention .CSV it will open correctly in excel.
    155 pointsBadges:
    report
  • Bigmac46
    This is a way to do it interactive. It is used to allow users to select info needed and download files that have been created after they get a message the files are ready to download. The only problem we have ever had is to recreate the needed pieces when a user gets a new PC. Then we copy from my PC or another user to put it back. It may not be "UP TO DATE' , But it will work. If uou want to you can even use rundll to open the excel after download is complete. Hope this helps AS400 PGM 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 Folder names are suggestions. Create “download” folder on PC, then Go to command prompt, move to “downloads” folder and edit, save, and the exit “Transfer.bat”. Transfer.bat(contains the 1 line below RFROMPCB /F C:downloadTRANSFERS.TXT ******************* Then edit, save, and exit TRANSFERS.TXT(names and path to the transfers. I save them in download folder for consistency) c:downloadtran1.TFR c:downloadtran2.TFR c:downloadtran3.TFR c:downloadtran4.TFR c:downloadtran5.TFR If you search there is a way to do run this from a batch job. Search RUNRMTCMD. and look for "running a PC application fron RPG. I have not tried the procedure yet because most of our application(as the one above) are on demand.
    1,000 pointsBadges:
    report
  • Bigmac46
    the back slashes are missing after all the "c:" and the word "download". ---- reverse the forwards in the following example(etc) . ’C:/download/transfer.bat’
    1,000 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