----------------------------
Matthew A. Murray
matthe...@mindspring.com
http://www.matthewmurray.net
----------------------------
Matthew Murray <hl...@plover.net> wrote in
news:Pine.LNX.4.44.02060...@zork.plover.net:
> There is a spool file on the AS/400 that I want to download as
> text, for additional manipulation, printing out, importing into another
> program, etc. I begin by creating a physical file (CRTPF), into which I
> copy the spool file's contents (CPYSPLF). Then, I initiate a transfer to
> get that physical file on my computer. I'm able to open the file on my
> computer, but it's utter gibberish, just lots of nonsense characters, and
> certainly nothing that looks like columns or the data I can see when I
> display the spool file on the AS/400.
First, you should use "*FCFC" or "*PRTCTL" (don't remember the parameter
name - these are just the values) - which will give you readable output.
*FCFC will result in a single line prefix byte which controls the line/form
feeding (channel control code). In one of the manuals, you could read the
complete definition, but you can test it yourself - try to feed 1 line, 2
lines, 3 lines, ... and so on - and just a form feed to - and you will have
all controll code very fast.
*PRTCTL will result in 4 bytes line prefix - 1 to control the "feed to line
x" and 3 bytes to control "feed xxx lines" - also simple.
In both cases, your PF records have to be 1 (*FCFC) or 4 (*PRTCTL) bytes
longer that the printer file lines.
If you don't use *FCFC or *PRTCTL, you will not have any line/form feed
control in you PF - may be nice in some very special cases, but ...
After that, make sure, that you download the file _with_ (!!!) EBCDIC/ASCII
translation and not in binray form (which will result in unreadable chars on
the PC).
I have written some sort of simple "DMS" this way, and it works just good.
HTH and bye
Daniel
There may be two reasons for you getting 'rubbish', which is most likely
non-translated EBCDIC.
If you use FTP for downloading, make sure you do an ASCII type download,
not BINARY.
If you still get rubbish, your PF probably has CCSID 65565 (I _think_
that's what the default is) and that may cause you problems. Make sure
your PF has CCSID 37 and you'll be OK.
If you just want the spoolfiles text, you don't need any formatting on
the CPYSPLF, but you may have a lousy PC-doc, since pageheadings will
appear immediately below the last line of text of the previous page,
which can kill report-readability. If you make your PF 4 chars wider
than your spoolfile print-length, you can use CTLCHAR(*PRTCTL ) to keep
the formatting info. On my website you'll find a macro for Word97 that
uses this info to reformat the doc once imported in Word. If you're
interested, you'll find it in the Downloads section.
--
Vriendelijke groeten / Kind regards
René H. Hartman
R.H. Hartman Automatiserings Consultancy
www.hac-maarssen.nl
-----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----
"Matthew Murray" <hl...@plover.net> wrote in message
news:Pine.LNX.4.44.02060...@zork.plover.net...
There's a program that can be used to convert a spooled file to an
RTF, TXT or HTML file and e-mail it included with the book "The
iSeries & AS400 Programmer's Guide to Cool Things" from MC Press
(http://www.mc-store.com/isasprogguid.html)
Quigon