On Mon, Dec 19, 2016 at 4:15 PM, Clark Morris <[email protected]>
wrote:

> [Default] On 19 Dec 2016 06:34:59 -0800, in bit.listserv.ibm-main
> [email protected] (Peter Vander Woude) wrote:
>
> >John,
> >
> >Tell them that their cobol routine will probably run around 11 times
> longer than the current assembler routine.
> >
> >Our programmers used to use a cobol to read in a file, for ebcdic to
> ascii translation, and then this subprogram would be called for each record
> to convert from ebcdic to ascii.  The job steps calling that routine spent
> over 90% of their cpu time in that subprogram.
> >
> >I re-wrote into hlasm, and eliminated at least 80-90% of the cpu time,
> just due to the efficiencies that the assembler code management of the data
> in a table, have vs cobol.
>
> I will lay odds that I could come up with the appropriate COBOL that
> is virtually as fast and if allowed to be inline far faster due to not
> having call overhead.  COBOL based on the 1985 standard has some
> really good constructs that take advantage of various things like the
> translate instruction.  Now if IBM would implement all of the data
> types in the 2002 and later standards including USAGE BIT and the
> various IEEE fixed binary, floating point binary and floating point
> decimal types.
>

​Clark,

Seems you are well versed in COBOL & I could use another bit of related
help, if you don't mind. The aforementioned programmer has also converted
my HLASM decompress routine (again, I didn't design these things, I just
cleaned up the HLASM last - i.e. "don't blame me!" [grin]). The RLE
algorithm was designed for compress / decompress "in place". So the code
basically scans "backwards". That is, from high addresses to low (end to
start of buffer). To decompress, it looks for a "decompression indicator
byte" (0xA0). It then extracts the two bytes (halfword binary count)
__before__ the 0xA0 as the number of which were compressed. ​Is there a
fast way to scan "backwards" in COBOL, other than just something like:

PERFORM VARYING OFFSET
                   FROM BUFFER_SIZE
                   TO 1
                    BY -1
        IF X'A0' = BUFFER (OFFSET:1) THEN
            ...
        END-IF
END-PERFORM

Would it be better to use an INDEX and REDEFINE an array of PIC X over the
buffer? Or maybe us ADDRESS OF and "pointers"?


FWIW - the programmer has tested his COBOL decompress & my COBOL compress
routines against the HLASM versions. The outputs are identical, so we at
least have something which is WAD (or BAD).
​         ​



>
>
> Clark Morris
>
>

-- 
Heisenberg may have been here.

http://xkcd.com/1770/

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to