Create FTP script file through UBE without key?

MikeS

MikeS

Member
Hi - I wrote a UBE that allows me to get a file via FTP from a third party website. This is a daily process, where the file name that I need to get, changes every day so I have to change the script file for the FTP process everytime the UBE is run. I created the script file as a table in One World and populate it via my UBE based on the Processing Options.

I then use the "Call External Program" BSFN to execute a CL program on the AS400 that handles the FTP utilizing the script file. The problem however is, that the script file is worked not the way it is entered because it of course has a key and that sorts the file alphabetically when it is executed. The script file only has one field in it with ten records that contain the 10 commands necessary to do the FTP. I tried inserting a second field to key on it with a numeric counter. Now the script is worked in the correct order BUT it of course does not work since that second field also shows up and gets appended at the end of each line behind the valid commands when the script is processed and so the commands do not work.

I then thought I could insert a third field between the two which contains a "comment" character, so it would ignore the key field when running the script by commenting it out but all my google searches came out blank. It looks like there is NO comment character within FTP scripts that works.

The only option left to me I think, unless any of you have a better suggestion, is to break down and do the script file generation completely on the AS400 using RPGIII (oh no!!) and CL programs. My RPGIII is very rusty so I would have preferred the UBE method, but I guess I am out of luck.

Any help is appreciated...

Thanks and Happy Holidays to everybody on this great forum from Texas....


Mike

B7333 XE SP23_J1 AS400 V5R3
 
Mike,

Not sure how much this will help, but here goes. We have a similar FTP script that needs to be changed to include a date/time stamp. In order to do this we left the FTP commands in a membered file on the AS/400, outside of JDE, and updated them using an SQL RPG program called from JDE. If you know SQL, they are pretty simple to write. It all depends on how you determine the new file. Let me know if you have any questions.

Joe
 
Joe,

Thanks for your reply. I am sorry for not answering sooner but I must have forgotten to put this thread into my favorites plus I had been pulled onto some other things (EPM install) these past few weeks and did not check here online also for any replies.

Now I am back at the FTP issue. I was able to use BSFN B34A1030 to get the FTP to work locally in PY/DV in the Windows/DOS environment by kicking of a script file to do the FTP however I must be still doing something wrong when trying the same on the i-series AS400 where I would need it to work.

Here are commands that I am passing or trying to pass on to the AS400 through B34A1030:

VA rpt_CommandString = concat("ADDLIBLE LIB(",concat([VA rpt_LibraryName],") POSITION(*LAST)"))

Execute External Program

VA rpt_CommandString = "CALL PGM(J63551F) PARM(P63551C EBF0001)"

Execute External Program

I decided to use rpt_LibraryName instead of the hardcoded library name since I wanted the program to work both in test and production without changes and our test library is XECRPDTA while our production library is PRODDTA.

In other threads I found that the libraries could be an issue so per those recommendations I first add the respective library and then try to start the CL with the second command.

I have not done much with the error portion of this BSFN. Could that help me to identify my problem? I tried checking the job log on the AS400 after running the UBE with these commands but could not find anything that would give me a clue why the FTP does not work.

Any additional info or may be example of the commands you pass on to your AS400 through this BSFN would be appreciated...

Thanks
Mike
 
Back
Top