[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sender: Scott Klement <klemscot@xxxxxxxxxxxx>
On Fri, 18 May 2001, Justin Kiteley wrote:
> > I can see why it'd be convienient for ASCII mode (when transferring from
> > an AS/400 to a PC) to translate from EBCDIC to ASCII... but how do we
> > know that we're not transferring to another EBCDIC machine when we do
> > this?
> The SYST command can do this. It displays the system type of the server you
> are sending to. When I connect to another AS/400 I get:
> 215 OS/400 is the remote operating system. The TCP/IP version is "V4R5M0".
> And to my PC I get:
> 215 UNIX Type: L8
> I think this is what the 400 FTP client does when connecting to a remote
> host to determine whether or not to do a translation.
> I'd assume that anything I was sending to a UNIX or Windoze machine would be
> translated to ASCII.
> Please correct me if I'm wrong here.
SYST returns the type of operating system, not whether it's ASCII or
EBCDIC. Are you suggesting that we have some sort of database that tells
us whether any given OS is ASCII or EBCDIC?
Even so... even if we know it's an ASCII machine, or an EBCDIC machine,
I still don't know what codepage the ASCII or EBCDIC is. Someone in
England, for example, will use a different codepage of ASCII than
someone in the USA.
> Regarding record based files, right now I am only sending flat PF's from the
> QSYS.LIB library system.
> I simply build the path to the file based on the library and file name
> passed to my ftpapi program.
Yes, all files in QSYS.LIB are "record based files". They are arranged
into fixed-length records. As opposed to stream files which aren't
This file _is_ a record based file. Doesn't matter if it's a "flat"
file, it's still broken up into well-defined records.
> > On that note, I need some input from you guys:
> > 1) Does anyone know a reliable way of determining if an object in
> > the IFS is a record-based file, a save file, or a stream file?
> > Keeping in mind that symbolic links could be used to make a
> > file in /QOpnSys/ (for example) point to a file in /QSYS.LIB
> > 2) Assuming that a file does need to be converted from EBCDIC to
> > ASCII, how can I know which codepage of ASCII to use?
> > 3) What if I'm talking to another AS/400 (or other EBCDIC machine)?
> > Could I safely assume that binary mode would be used in that
> > scenario?
> 1) Don't have any info for this one, but it will be important to me soon,
> so I'll check it out.
Actually, I've got some ideas on this one... I've got to experiment a
bit more, but I think I'm on track... (I stayed up late last night
researching that one)
> 2) Isn't there a standard ASCII codepage? codepage 819 maybe?
All the code pages are standard. For example, the codepage normally
used in MS-DOS is codepage 437. Codepage 819 is another ASCII codepage,
also standard. IF you live in Italy, there's another codepage which
might be your standard...
So we could just pick one (If we do that I'd pick 437) or we could give
an option in the FTPAPI somehow to allow the user to pick which codepage
to translate to... which might be a feature...
> 3) I can't think of a scenario where ASCII would ever be used. Unless
> conversion to an IFS ASCII object from an EBCDIC object in the
> QSYS.LIB structure is needed. I guess the conversion should be
> available, but up to the programmer to decide and be defaulted to
> BINARY mode.
Huh? Aren't you the one who is complaining that your document isn't
being converted to ASCII? Why are you now saying that you can't think
of a scenario where a file should be converted to ASCII?!
> Hope this helps, I'm looking forward to how this develops.
> PS. Scott, can you post your first 2 questions to the midrange rpg list?
> It's on topic if you qualify it with. "how do I do this in RPG 4" I think
> we might get some good answers there.
I could do that. Though, I think it'd be hard to explain what I'm doing.
I'd get lots of answers from people telling me how to use iconv() and/or
QDCXLATE which wouldn't really help (I already know how to do that)
The problem is, I know how to translate data in RPG, but I don't know how
to KNOW which codepage to translate to (aside from asking the user/pgmr)
So... this isn't really an RPG question, it's a general "how do you know
which codepage to translate to" question...
Perhaps what I SHOULD do is see what IBM's doing in their FTP client... :)
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
- Prev by Date:
- Next by Date:
- Previous by thread:
- Next by thread: