Question

  Asked: May 7 2008   0:57 AM GMT
  Asked by: Nutan


AS400 to Windows control application


AS/400, RPGLE, RPG, CL

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.

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0




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.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Windows » AS400 to Windows control application  |   May 7 2008  2:57AM GMT

[…] Levent Ozen on ziki.com wrote an interesting post today on AS400 to Windows control applicationHere’s a quick excerptNew Question Created… […]

 

Nutan  |   May 9 2008  12:14AM GMT

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.

 

Gilly400  |   May 9 2008  11:21AM GMT

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.

 

Nutan  |   May 11 2008  2:39PM GMT

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

 

Gilly400  |   May 13 2008  11:19AM GMT

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.