Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending variable to FTP script file

429 views
Skip to first unread message

Kevin

unread,
Aug 18, 2000, 3:00:00 AM8/18/00
to
I am downloading orders from a Linux system to the 400. After getting the
orders I need to produce a confirmation file to be placed back on the Linux
box. I can build the confirmation on the 400 easily. The problem lies in
the fact that the filename, on the Linux system must be unique for each
customer. For example, if the order is for customer 123456, the filename
would be 123456.ack. I am using a CL with an override to file that
contains my ftp commands. How can I pass the filename file containing my
commands so it will be correct on the Linux box?

Jim Mattheiss

unread,
Aug 20, 2000, 3:00:00 AM8/20/00
to
I did something similar in the past:

We were sending files to an FTP server daily. The files were numbered
sequentially ( Fil001, Fil002,Fil003, ...)

What I did was run a sql update statement against the script file:

update script set text = "put localfile remotefile" where text like "put%"

Then run the ftp session against the script.

Worked for me.

Jim Mattheiss

Kevin wrote in message ...

Bryan Douglas-Henry

unread,
Aug 21, 2000, 1:28:10 AM8/21/00
to
When you build the file with your FTP commands, you can specify the file
name on the 'put' command.
e.g. put f123456.f123456 123456.ack

You may need to use an RPG/ SQL program to build your ftp commands file in
qtemp (for this job) - he's the guy you give the parameter to.

Regards,

Bryan


"Kevin" <kemd...@bellsouth.net> wrote in message
news:Cpnn5.13110$KD1....@news1.atl...

Kevin

unread,
Aug 21, 2000, 3:00:00 AM8/21/00
to
So you are basically saying I have to build my ftp script on the fly? More
work than I was hoping for but I guess it will have to do. Thanks for the
help.

-Kevin


Bryan Douglas-Henry wrote in message <8nqel5$jqs$1...@ctb-nnrp2.saix.net>...

Bryan Douglas-Henry

unread,
Aug 22, 2000, 2:22:57 AM8/22/00
to
Hey Kevin

Yup - build it on the fly - using a CMD to input the parameters, which will
then use a CL to build a work file in QTEMP, do the overrides and call the
RPG program to populate the work file.

OVRDBF FILE(INPUT) TOFILE(QTEMP/FTPINP) MBR(*FIRST)
OVRDBF FILE(OUTPUT) TOFILE(QTEMP/FTPOUT) MBR(*FIRST)
CALL PGM(RPGPGM) PARM(&USRPWD &CMD &FULLFILE +
&LIB &DIR)
STRTCPFTP RMTSYS(&SERVER) /* <== This line does the actual FTP */

You can then call another RPG to read QTEMP/FTPOUT to check the FTP job went
through ok.


Here's my QRPGSRC member - I pass 5 parameters to him (using a cmd and cl
front-end)

File FTPINP has one field called FTPDTA - 60 long.

FFTPINP O E DISK
C *ENTRY PLIST
C PARM USRPWD 20
C PARM CMD 10
C PARM FILE 43
C PARM LIB 10
C PARM DIR 20
* WRITE USER & PWD
C MOVE *BLANKS FTPDTA
C MOVELUSRPWD FTPDTA
C WRITEFTPFIL
* CHANGE DIRECTORY
C DIR IFNE *BLANK
C MOVE *BLANKS FTPDTA
C MOVEL'cd ' TXT3 3
C TXT3 CAT DIR FTPDTA
C WRITEFTPFIL
C END
* CHANGE LOCAL DIRECTORY
C MOVE *BLANKS FTPDTA
C MOVEL'lcd ' TXT4 4
C TXT4 CAT LIB FTPDTA
C WRITEFTPFIL
* PUT/ GET FILE
C MOVE *BLANKS FTPDTA
C MOVELCMD TXT10 10
C TXT10 CAT FILE FTPDTA
C WRITEFTPFIL
C SETON LR

--
Regards,

Bryan Douglas-Henry
br...@mediscor.co.za

Send your spam to: rhu...@fcc.gov jqu...@fcc.gov sn...@fcc.gov
rch...@fcc.gov


"Kevin" <kemd...@bellsouth.net> wrote in message

news:7kko5.3616$Ez6....@news3.atl...


> So you are basically saying I have to build my ftp script on the fly?
More
> work than I was hoping for but I guess it will have to do. Thanks for the
> help.
>
> -Kevin
>
>
> Bryan Douglas-Henry wrote in message <8nqel5$jqs$1...@ctb-nnrp2.saix.net>...

Michael Frilot

unread,
Aug 22, 2000, 10:24:08 PM8/22/00
to
Don't create the file in qteimp... if you run this in batch you won't
know what errors you had duing the ftp process.

mf

0 new messages