Site command used in ftp script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Site command used in ftp script
# 8  
Old 07-13-2007
Thank you shell life,
we will learn a lot from this.

When I do understand your piece of scripting right, then it does the while-loop 500 times for each record. We come from the mainframe and we have files of more than 1 milion records, so I don't think this is an option for us.

Thanks.

Sandra
# 9  
Old 07-13-2007
We know now! An old colleague helped us.
Ftp from unix to a mainframe does not work properly. It cuts of at 256 digits.

We need a fixed recordlenght.
We will have to use
quote site fixrecfm 500
site command would put it to recordlenght 500 locally. And quote site does this on the remote site, to where it is ftp-ed.

Have a good day and a good weekend!!

Sandra
# 10  
Old 07-13-2007
Selecting record format and record length for CMS.
By default, all files transferred using FTP will have variable record format. If you are transferring a file to CMS which must/ought to be in a fixed record format or which should have a specific record length, use the site command of FTP on CMS.
Before GETing files to CMS using FTP on CMS, enter:
site fixrecfm nnnn
Before PUTing files to CMS using FTP on a PC or another local host, enter:
quote site fixrecfm nnnn
in both cases, nnnn is the record length you want the transferred file to have. The quote command sends the specified command to the remote FTP for execution. The command site varrecfm restores the default variable record format. (Include quote if necessary.)

From: http://www.uic.edu/depts/accc/network/ftp/vftp.html

Sandra
# 11  
Old 07-13-2007
Quote:
When I do understand your piece of scripting right, then it does the while-loop 500 times for each record.
Sandra,
The while-loop 500 times is just to assign 500 pipes '|' into one variable.
It is performed only once.
The second while-loop is the one that reads the entire file and tries to attach
the 500 characters variable at the end of each record.
The result length of each record is 500, which is written to the output.
# 12  
Old 07-13-2007
Oh yes, I see.
Thanks.
I've learned a lot today.
Thanks.

Sandra
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To merge files on FTP site before getting them

I have a job that connects to FTP site, rename, get, delete a file and then process it. The renaming is done in consideration of this is one file name into which data is being accumulated many times within 24 hour cycle. This is what happens now: ftp -i $FTPHOST <<-EOF ren... (3 Replies)
Discussion started by: migurus
3 Replies

2. SCO

FTP problem with site exec command

Hello dear Users, I am for the first time in this forum. I come from Germany. Please excuse my bad englisch. My OS is SCO open Server Release 5. I have a problem whith FTP and the command "site exec" if I use the command "ftp> site chmod 777 /tmp/startkpf.sc 200 CHMOD command successful. ... (8 Replies)
Discussion started by: fla5do
8 Replies

3. Shell Programming and Scripting

lftp script to connect to external sftp site and download to internal ftp and then send email

Hi there, I'm new to shell scripting and need some help if possible? I need to create a shell script (.sh) to run as a cron job on an ubuntu linux server to connect to an external sftp sites directory using credentials (which I have) and then download to our internal ftp server and then copy... (3 Replies)
Discussion started by: ghath
3 Replies

4. UNIX for Dummies Questions & Answers

SCP -r from Secure FTP site

Hi all, My problem is simple. I would like to download the contents of a directory on an ftp site. I can access the site through windows, but there are many files and it would be too tedious to click and download each file. Thus, I am trying to use scp -r... (5 Replies)
Discussion started by: cpabrego
5 Replies

5. Shell Programming and Scripting

script for download files from ftp site

I'm new to scripting. I'm trying to write a script to download files from ftp site, the following is the script and the message i get after running the script. no files were downloaded :( Thanks advance! script: #!/usr/bin/ksh DAY=`date --date="-1 days" +%y%m%d` ftp -v -n "ftp.address" <<... (5 Replies)
Discussion started by: tiff-matt
5 Replies

6. Shell Programming and Scripting

Pulling a list of files from FTP site in a shell script

Hi, I am writting a shell script which will pull a list files (mentioned in one file 1.txt) from external FTP site (for ex: ftp://abcd.efghijk.com/). The 1.txt is in my local unix directory. I have username and password to connect the external FTP site. Also before I pull the files, I need... (0 Replies)
Discussion started by: spatra
0 Replies

7. Solaris

SITE command of FTP not working

Using FTP on Solaris 5.8, I am not able to use the SITE command. It says Invalid command. I am trying to change the permission of the transmitted files to -rw-rw-rw on the destination machine. Any help would be greatly appreciated. (2 Replies)
Discussion started by: gauravsachan
2 Replies

8. UNIX for Advanced & Expert Users

Polling an FTP site for a file

Hi, I'm after a bit of advice for the best way to collect files from an ftp server via a unix process. The main issue here is the frequency, the job needs to check for files every minute or so between 8am and 8pm and pull them down to the box if there is anything there. Originally the... (6 Replies)
Discussion started by: Peejay
6 Replies

9. Windows & DOS: Issues & Discussions

mapping FTP site as local drive

I have a small problem, there is one Win98 PC on our network, and I would like to map the FTP server that we have as one of the Win98's machine's local drives. I am by no means a Windows expert, instead my area is *NIX. The webserver is just a regualar webserver, within the LAN. I tried... (18 Replies)
Discussion started by: cerberusofhate
18 Replies

10. UNIX for Dummies Questions & Answers

ftp protocol and quot site chmod 0

i do have a problem with the transaction of pdf-files from a server to another. there was a guy who told me about this command wich i should build in my ftp.put()-method in java. the command called: about quote site chmod 0 filename.. i think its something about filerights but does someone know... (1 Reply)
Discussion started by: calmacroi
1 Replies
Login or Register to Ask a Question