[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Fwd: gnubol: Record delimiter clause and parse order]



Regarding ASCII/EBCDIC and EBCDIC/ASCII conversions:

There are several products that do this (for files).  This is a NON-trivial
task.  Things to consider when creating such a tool. (Not all of these need
to handled in "phase 1" - but they all need to be considered).

1) It is necessary to provide conversion BOTH ways.  Otherwise, files created
in an ASCII environment will not be "verifiable" in their "home" EBCDIC
environment.

2) The "usual" way for determining which fields need conversion (and more
importantly which do NOT) is to provide copybooks of the file layouts.  The
tool should be able to read this and determine which "bytes" need conversion
and which do not.  Conversion should occur as follows:

 A) PIC X gets converted between EBCDIC and ASCII
 B) COMP, COMP-4, and BINARY usage get converted from big-endian to
little-endian (if that is what you are using on the workstation for these
fields)
 C) PIC 9 USAGE DISPLAY get "sign-nibble" fixes (if you are using different
sign conventions on the PC - which is pretty common but not universal). Same
for PACKED-DECIMAL and COMP-3.
 D) COMP-1 and COMP-2 get converted from/to S/390 floating point from/to IEEE
floating-point (if that is what you are using on the PC)
 E) (probably JUST flag initially - but conversion should be a long range
goal) DBCS items get converted from IBM DBCS to Shift-JIS (or Unicode)

3) REDEFINES at the 01-level (and below) need to be handled.  This usually
requires a "logical record layout selection" option.  This is something that
works like:
  If field-1 = "A" then use record-layout-1
  Else if field-2 = "B" then use redefines of group-2

   ***

Back to the question of the RDW (record descriptor word) which is what the
4-bytes before a Variable (blocked or NOT blocked) record has on IBM
mainframes.  There are still mainframe programs that negative-subscript to
get to this field.  Although I would recommend AGAINST trying to exactly
duplicate the IBM mainframe file structure, this is a "useful" (but
non-Standard) thing to have available to COBOL programs.  Therefore, even if
the file doesn't use these 4-bytes (as IBM does), I suggest that you
"allocate" such bytes immediately in front of every record.

> -----Original Message-----
> From: owner-gnu-cobol@wallace.lusars.net
> [mailto:owner-gnu-cobol@wallace.lusars.net]On Behalf Of Theodore J.
> Seward, Jr.
> Sent: Sunday, June 04, 2000 11:20 AM
> To: gnu-cobol@lusars.net
> Subject: Re: [Fwd: gnubol: Record delimiter clause and parse order]
>
>
> Tim,
>
> 1.  How do I upload the software?
>
> 2.  Are there extra standards beyond the GNU standards that were
> established for the COBOL compiler routines that I should follow,
> e.g. special arguments that should be present, debugging options,
> special routine naming conventions, etc.?
>
> 3.  Since VB file record lengths are stored in binary, they will have to
> be transferred to and from an IBM mainframe in binary.  Trying to
> translate them to ASCII on transfer would destroy the descriptor words.
> With this in mind, I could supply you with a separate tool to translate
> ASCII / EBCDIC.  I guess it should have the ability for the user to
> indicate where IBM packed decimal and binary (fixed & floating) are
> present in the records so they can be converted as well.  Any comments
> on this?  Perhaps the user parameters should be in the form something
> like a COBOL record layout so it knows the exact locations, e.g. input
> "PIC S9(4) COMP-3" to "PIC S9(4)".
>
> 4.  I just downloaded the "GNU Coding Standards" by Richard Stallman,
> last updated June 1, 2000 at:  http://www.gnu.org/prep/standards.html
>
> 5.  I just downloaded the LGPL as you specified, which I assumed was the
> "GNU Lesser General Public License",  Version 2.1, dated February 1999
> at:  http://www.fsf.org/copyleft/lesser.html
>
> Thanks Much - Ted Seward
>
>
> Tim Josling wrote:
>
> >
> > Ted,
> >
> > Yes please do so, very useful. Bear in mind the following
> >
> > 1. Follow GNU coding standards which you can get from www.fsf.org
> > 2. Can you structure the code so that it can be used as a
> > standalone utility and as a set of routines to call from the
> > Cobol runtime.
> > 3. C not C++.
> > 4. Licence under the LGPL to allow the above (see www.fsf.org for
> > details of the LGPL licence)
> > 5. Try and make the code work regardless of the big/little endian
> > nature of the CPU you are using.
> > 6. Publish your code as you go, even when rought and incomeplete
> > (like my compiler:-)).
> >
> > Sorry about the delay in replying.
> >
> > Happy to answer any questions.
> >
> > Much appreciated,
> > Tim Josling
> >
> > "Theodore J. Seward, Jr." wrote:
> > >
> > > Ralph,
> > >
> > > I got on the gnubol mail list to watch the status of the GNU
> COBOL.  I saw your comments on VBS (Variable Blocked Spanned)
> Records.  I've dealt with the file off and on over the past 20+
> > > years (assembler, cobol, PL/1, etc.).  It would be easy for me
> to give you a set of I/O routines to read / write the IBM variable
> block record types in C.  Their main use would be to
> > > convert files being FTP'ed to or from an IBM mainframe (I
> doubt people would use this format unless they had to).  If you
> would like, I could package it as a batch utility that could be
> > > used to convert files to or from this format, kind of a bridge.
> > >
> > > If I can be of any help in this regard, please let me know.
> Of course, the routine and/or utility would have the free software
> GPL license on them.
> > >
> > > Good Luck - Ted Seward
> >
> > --
> > This message was sent through the gnu-cobol mailing list.  To
> remove yourself
> > from this mailing list, send a message to majordomo@lusars.net with the
> > words "unsubscribe gnu-cobol" in the message body.  For more
> information on
> > the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.
>
>
> --
> This message was sent through the gnu-cobol mailing list.  To
> remove yourself
> from this mailing list, send a message to majordomo@lusars.net with the
> words "unsubscribe gnu-cobol" in the message body.  For more information on
> the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.


--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.