Re: Standard way to implement ASCII control chars

From: William M. Klein (wmklein_at_nospam.netcom.com)
Date: 12/07/03

  • Next message: Binyamin Dissen: "Re: Internal Sorts"
    Date: Sun, 07 Dec 2003 06:38:08 GMT
    
    

    As far as collating issues go, I think (but won't swear to it) that all
    current/modern compiler support the full set (assuming 8-bit bytes) of
    characters from X"00" thru X"255" - what they MEAN differs from environment to
    environment.

    Even on a 7-bit machine, Function Char (11) *should* yield a X"0A" (unless it
    is a REALLY odd implementation that somehow "skips" some bit patterns).

    Certainly a

       Replace ==X"0A"== by =="~".

    where you hex-edit the "~" to get a X'0A' *should* work, but there may be other
    side-effects if your programs use REPLACE for any other items as the '85
    Standard has no "cumulative" REPLACE function (as the 2002 Standard does)

    P.S. If your generator software company is using an apostrophe (') rather than
    a quotation mark (") - then this is another reason that they are NOT conforming
    to the '85 Standard.

    Depending on your "contract" with the vendor (or their advertising) you might
    ask them to provide you with ANY compiler output (almost any '85 Standard
    compiler) where you get a CLEAN compile without any ANSI or FIPS flagging
    messages - when such flagging (as the '85 Standard requires compiler vendors to
    provide as an option) is turned on.

    Sounds to me as if this vendor has NO IDEA of what is and isn't in the '85
    Standard!!!

    -- 
    Bill Klein
     wmklein <at> ix.netcom.com
    "Douglas Gallant" <no@spam.net> wrote in message
    news:AGxAb.190470$ZC4.123135@twister.nyroc.rr.com...
    > Keeping in mind that the third-party vendors I'm dealing with are delivering
    > code generators, Option 2 is the only viable solution of the two presented.
    > Since you didn't mention anything relative to the collating sequence issue,
    > does that mean it's a non-issue, not likely to be an issue or this is the
    > best platform neutral solution I'm likely to find? Also, if the vendor is
    > going to stick with just '85 support (no Functions), do I have any other
    > real alternatives? I have considered the possibility of inserting a REPLACE
    > into the generated code to get the desired results. I don't like having to
    > modify the generated code but if it was a generic REPLACE for these routines
    > it might be acceptable.
    >
    > As for a 2002 compiler, yes Unisys does have one. However, last I checked,
    > their implementation rendered it completely unusable in my environment.
    >
    > "William M. Klein" <wmklein@nospam.netcom.com> wrote in message
    > news:bLvAb.2276$_r6.75@newsread1.news.pas.earthlink.net...
    > > A couple of possibilities.
    > >
    > > 1) Create a VALUE clause like
    > >     Value "Q"
    > > and use a hex-editor to change that "Q" to the hex value you want.  (This
    > will
    > > NOT work if your compiler expects "line sequential" type source code
    > rather than
    > > "record sequential" type source code.)
    > >
    > > 2) If you have an '89 Standard compiler (rather than just '85) - i.e. you
    > have
    > > intrinsic functions, you should be able to code
    > >
    > >   05  Line-Feed  Pic X.
    > >         ...
    > > Move Function Char(11) to Line-Feed
    > >
    > > to move X"0A" to that field  (You use "11" not "10" - as X"00" is created
    > by
    > > CHAR(1))
    > >
    > >    ...
    > >
    > > FYI, as the X"0A" format is a part of the 2002 ANSI/ISO COBOL Standards,
    > you
    > > might contact your "vendor of choice" to ask when they plan on
    > implementing this
    > > feature of the CURRENT ANSI Standard (the '85 Standard is no longer a
    > "valid" -
    > > current or recognized - ANSI or ISO Standard).  Many vendors are
    > interested in
    > > implementing SOME parts of the 2002 Standard, even if they have no
    > (current)
    > > plans on implementing it all.
    > >
    > > -- 
    > > Bill Klein
    > >  wmklein <at> ix.netcom.com
    > > "Douglas Gallant" <no@spam.net> wrote in message
    > > news:havAb.190447$ZC4.113271@twister.nyroc.rr.com...
    > > > Using only COBOL 85 syntax, what is a portable method of representing
    > ASCII
    > > > control character values in a PIC X(1) field?
    > > >
    > > > The problem that I have encountered is that two separate vendors,
    > claiming
    > > > to produce COBOL 85  Standard syntax, both end up with a field like
    > > > LINE-FEED PIC X(1) VALUE X'0A' in their code. To the best of my
    > knowledge
    > > > hex constants are non-standard (though widely implemented) and my
    > compiler
    > > > (Unisys 2200 series UCOB) will not accept that. For my specific compiler
    > I
    > > > know how to do this rather simply but that is based on either vendor
    > > > extensions or knowledge of USAGE BINARY allocation rules which are also
    > > > vendor specific. The best I've been able to muster so far as a solution
    > > > would be MOVE FUNCTION CHAR(10) TO LINE-FEED. It should work but the
    > > > function is collating sequence aware so would only hold true if an ASCII
    > > > collating sequence were being used. I'm sure there is a common solution
    > to
    > > > this that I have overlooked so any help would be appreciated.
    > > >
    > > > Douglas Gallant
    > > >
    > > >
    > >
    > >
    >
    >
    

  • Next message: Binyamin Dissen: "Re: Internal Sorts"

    Relevant Pages

    • Re: ANSI C compliance
      ... > We are discussing whether this newsgroup should focus on 100% ANSI C ... > is a C standard which is defined by an international committee. ... behaviour of programs compiled with a C compiler, ... vendor then there are newsgroups for that too. ...
      (comp.lang.c)
    • Re: C 99 compiler access
      ... >another vendor with a better appreciation of standards. ... had got it wrong" because the standard was not tracking their compiler ... embedded code and wondered why it did not work when they tried to re- ...
      (comp.lang.c)
    • Re: Why the VB6 versus VB.NET contest is baloney
      ... You then have a core language ... not tied into a single vendor with no real recourse. ... Mono compiler, and the dotGNU compiler. ... I kept providing the [insert your favorite Standard language] template thinking Michael was trying to sandbag but apparently not. ...
      (microsoft.public.vb.general.discussion)
    • Syntax (another approach/thread)
      ... I thought that I would start another thread on the whole issue of "syntax". ... Standard to specify when source code is "guaranteed" to compile without any ... on) when compiled with a conforming compiler. ... not officially supported by the vendor. ...
      (comp.lang.cobol)
    • Re: Is C99 the final C? (some suggestions)
      ... > that someone will try compile their stuff on an old compiler. ... > because the ANSI standard obsoleted them, and everyone picked up the ANSI ... fixed by using another language. ... >>are multiplying two expressions of the widest type supported by your ...
      (comp.lang.c)