I can only get it to work binary, but then I can't read the files.
What do I need to specify to convert the files to ASCII text?
Thanks,
Steve
Not sure if you're talking A-series or 2200 - both TAS and CpFTP on the
2200 work with ASCII transfers to NT (and W2K and XP Pro too). (We use
them all the time, sending source code up to compile, and retrieving the
results.)
As far as what's required to view it after a binary transfer, the 2200
uses a 9-bit character, so you'd need something to drop that high bit to
get it to 8-bit.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / Live from Montgomery, AL! ~
~ / \/ o ~
~ / /\ - | AIM: LXi0007 ~
~ _____ / \ | E-mail: DanielJS "at" Knology.net ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove NOSPAM to e-mail me...
open
<ip address of NX system>
<usercode on NX>
<password on NX>
cd "on <packname of NX>"
binary
get
FILE/ON/THE/NX/SYSTEM
c:\file\on\the\nt.con
ascii
get
ANOTHER/FILE/ON/THE/NX/SYSTEM
c:\file\on\the\nt.txt
quit
It's A-series (LX5420).
I try to download the files as ASCII;
when I send the FTP command:
get "BD/062403/FILENAME ON PACKNAME" file1
i get the response:
Prepare Error: Bad File Attribute = FILEKIND
If I download the files as BINARY, they copy no problem, but I can't
read them on NT system.
The file type is BACKUPPRINTER.
Thanks,
Steve
You're out of my knowledge area, then... :) But into many others, so
hopefully they'll be able to help you out.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ AIM: LXi0007 ~
~ _____ / \ | ~ E-mail: LXi...@Netscape.net ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ I do not read e-mail at the above address ~
~ Please post if you wish to be contacted privately ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A printer backup file (spooled output for a printer) is mixed text and
binary -- the actual data is text but there's control information in
binary. That's why you can't FTP it as text without some
transformation.
Keith Landry gave you some pointers on modern methods, especially ones
which can be automated. Here are a couple of methods for one-time,
occasional, or ad hoc use.
1) It's possible for file transfer programs to do the transformation,
though FTP does not. One file transfer program which will do the
transformation is MGS's FMA (File Manager for A-Series).
2) You can do a CANDE BACK on the printer file, then do a COPY within
the BACK utility to copy it to a flat file, and finally FTP the flat
file in text mode.
Edward
I am thinking of two options :
1) you could configure an MCP dummy printer that would create a simple .txt
file when "printing" the file. Such a printer is very easy to configure,
and you can easily ftp the resulting txt file.
2) instead of using ftp, you can use the regular copy command, to directly
copy from MCP.
Assuming that you have created on the MCP a shared directory (named BD) that
is linked to your BD directory, your script could be something such as :
net use \\MCPserver\ipc$ /u:usercode password
copy \\mcpserver\bd\062403/FILENAME destinationfile
or
net use m \\mcpserver\bd /u:usercode password
copy m:\062403/FILENAME destinationfile
Does that help ?
Thanks. I thought about that but my scripting skills on DOS are not
advanced enough to translate the forward slash to a backward slash.
I'm generating a script after getting the filelist. The problem is
some of the files have the same name but are in different
sub-directories so I have to get each original filename and copy it to
file1, file2, file3, and so on.
Here's a snipet of my DOS batch file in case anyone has suggestions:
REM create ftp file to get filelist
echo user > ftpmcp.txt
echo pswd >> ftpmcp.txt
echo ls "BD/%RDTE%/= ON PACKNAME" filelist.txt >> ftpmcp.txt
echo bye >> ftpmcp.txt
REM get the list of files for %RDTE%.
ftp -s:ftpmcp.txt 192.168.0.2 1> nul
REM strip out just the filenames
find /n "BD/" filelist.txt | find /v "-----" > justfile.txt
REM create ftp file to copy each file with number incr.
echo user > ftpmcp2.txt
echo pswd >> ftpmcp2.txt
echo type BINARY >> ftpmcp2.txt
for /f "tokens=1,2 delims=[]" %%x in (justfile.txt) do (
echo get "%%y" file%%x >> ftpmcp2.txt
)
echo bye >> ftpmcp2.txt
REM now execute the ftp script to copy files from MCP to local
directory
ftp -s:ftpmcp2.txt 192.168.0.2 > getfiles.txt
:END
So now, options are:
1. copy the files instead of using FTP, but need to transalate slashes
and may require another application to do so.
2. configure a dummy printer to generate a straight text file for ftp.
(will have to read up on that method)
3. do CANDE BACK on the file and copy within the BACK utility to
generate a straight text file for ftp. (will have to read up on that
as well)
I really appreciate everyone's input. I learning a lot from this
experience.
Thanks again,
Steve
I found my solution!
I found another message on alt.msdos.batch.nt detailing a script
called chngstr1.cmd.
It's exactly what I needed to create a batch job from my MCP filelist
so I could copy the files from MCP to my NT server.
Thanks again for everyone's feedback!!!
True enough for FILEKIND=BACKUPPRINTER.
But for the newfangled FILEKIND=PRINTFILE, which you get when you create
a printer backup file with FILESTRUCTURE set to STREAM, the data is just
text and delimiters.
From the File Attributes Manual's description of FILESTRUCTURE:
For backup files with a KIND attribute value of PRINTER, setting
FILESTRUCTURE to STREAM results in the creation of delimited
character-stream disk files, which can be read at a future time
by other disk files and can be transferred to other operating
systems with a mechanism such as FTP. Delimited backup files are
created with the following attributes and values:
• FILECLASS = CHARACTERSTREAM
• EXTDELIMITER = CRCC
• FILEKIND = PRINTFILE
Although printer backup files are character-stream files, there
is no change to the structure of the logical files. The files
continue to be record-oriented and each block represents one
print record. The MCP inserts the appropriate delimiters at the
end of each block based upon the carriage control specified when
writing the files:
• Double spacing is represented in printer backup files by an
additional carriage return-line feed pair after the delimiters at
the end of the first print line.
• A channel skip is represented by a carriage return-form feed
pair, regardless of the destination channel.
Unlike files with a FILEKIND attribute value of BACKUPPRINTER,
there is no embedded binary control information. Software
translation is allowed and the delimiters are inserted in the
EXTMODE character set. The EXTMODE attribute value must
correspond to a character set that is EBCDIC-based, ASCII-based,
UCS2, or UCSNT.
And from the System Commands Manual's description of SYSOPS:
SYSOPS BACKUPFSDEFAULT
SYSOPS BACKUPFSDEFAULT ALIGNED180
SYSOPS BACKUPFSDEFAULT BLOCKED
SYSOPS BACKUPFSDEFAULT STREAM
Display or set the value for the BACKUPFSDEFAULT option. This
option assigns the default FILESTRUCTURE value for printer backup
disk files. By default, the value is ALIGNED180.
--
Tom Herbertson
Unisys (Net2: 656 6427) Mail Stop 320, Mission Viejo CA 92691-2792 USA
Voice: +1 949 380 6427 mailto:tom.her...@unisys.com (office)
FAX: +1 949 380 6560 or mailto:herbe...@cox.net (home)
- My opinions are my own; I do not speak for Unisys or anyone else -