AS400 to Windows control application

70 pts.
Tags:
AS/400
CL
RPG
RPGLE
Hi there, I am automating a AS400 based process. The process gets inputs from notepad files on Windows server. After I have processed these files through my RPG, CL programs, I need to take following steps I have 14 files in a windows folder. 1. Create a new folder on windows server. 2. Move those text files in the newly created folder. Is this something which can be handled through AS400 programs? Please advise..... Thanks, Nutan.
ASKED: May 7, 2008  12:57 AM
UPDATED: May 13, 2008  11:19 AM

Answer Wiki

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

Hi,

You have several different ways of doing this :-

You could use the QSHELL environment (you will need access to your windows server as a share).
Or you could use FTP (but this isn’t a very practical way).

In either case you will need to run some sort of script. You can either create a permanent script which you can run each time, or you can create a new script each time based on parameters. Your choice of which way to go with this will depend on the tasks the script needs to do. In your example you need to create a new folder, if you need to specify a different name for your folder every time the script runs, then you’ll probably need to build a new script each time (with the name for the new folder in it).

Regards,

Martin Gilbert.

Discuss This Question: 5  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
  • Nutan
    [...] Levent Ozen on ziki.com wrote an interesting post today on AS400 to Windows control applicationHere’s a quick excerptNew Question Created… [...]
    0 pointsBadges:
    report
  • Nutan
    Thanks Martin, I am not clear with the script you mentioned... writing a new script every time is not what i am looking for as i need to automate this process. Can I do something using CLLE or RPGLE on AS400 server. Is there any command on AS400 in CLLE through which I can create a folder in windows and cut paste the text files present in windows server to the newly created folder. Please advise. thanks, Nutan.
    70 pointsBadges:
    report
  • Gilly400
    Hi, I suggest the following :- Write an RPG program that creates a file with the script, based on parameters passed in to the RPG program for example :- RPG program has parameters FromFileName, FromFolderName, ToFileName and ToFolderName. Program creates/updates a file with the following lines in it :- MD ToFolderName CD ToFolderName CP /FromFolderName/FromFileName /ToFolderName/ToFileName This should create your new folder and copy a file to it. You could replace the 'CP' with 'MV' to move your files. Make a CL program with the same parameters, with a CALL to your RPG program to create your script file, followed by a QSH command to process your script :- QSH CMD('/QSYS.LIB/yourlib.LIB/yourfile.FILE/yourmember.MBR') Replace the yourlib, yourfile & yourmember with the library, file and member names for your script file. Then you call your CL program with each of the 14 files that you need to process. Hope this helps, Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Nutan
    Hi Martin, Thanks for adding the Qshell concept to my knowledge repository. while running the Qshell command through CL program, I am getting file not found error------- /QSYS.LIB/ztstgujn1.LIB/qrpglesrc.file/ccuzr6.mbr: 001-0019 Error found searc hing for command V001. No such path or directory. QSH CMD('/QSYS.LIB/ztstgujn1.LIB/qrpglesrc.FILE/ccuzr6.MBR') this is the path for my rpg script. library - ztstgujn1 src PF - qrpglesrc pgm name - ccuzr6 Am i missing on any part or doing anything wrong...Please help. Thanks, Nutan
    70 pointsBadges:
    report
  • Gilly400
    Hi Nutan, It looks like there's an invalid command in your script member. It has found the member OK. Do you have a line with V001? Regards, Martin Gilbert.
    23,730 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