Re: UNSTRING performance issue



In article <1133283853.139599.62380@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Chris <ctaliercio@xxxxxxxxx> wrote:
>Sorry doc - trust me - this isn't homework. More like an old dog
>looking for a new trick.

Workwork can take the form of homework... I was using 'homework' in the
sense of http://m-w.com/dictionary/homework, '3 : preparatory reading or
research'. It was intended as a compliment.

[snip]

>To clarify, in my world, the nth field is the field following the
>(n-1)th delimiter. So in your your example string:
>
>VAL1,,VAL2
>
>VAL2 is actually the 3rd field, with the 2nd field containing a "null"
>value.

Thanks for the clarification.

>The only reason I posed this question is because I actually found a
>source in my library where the original author has defined JUNK-x
>fields in the WORKING-STORAGE section in order to "pad" his unstring
>statements. Instead of looking for a better way to get to the 59th
>value in a set, that person actually has declared JUNK-01 all the way
>up to JUNK-58 (all as pic x(1) variables). The unstring statement is a
>beast to behold, consuming over 60 lines, since he enumerates each
>JUNK-XX field on its own line.
>
>
>To my way of thinking, while the code works, this is not exactly "best
>practice."

Bingo... it works and nobody complains too much about the efficiency. It
smells like it was coded for IKFCBL00, the IBM compiler for the '74
Standard (sometimes referred to as OldBOL); inline PERFORMS were not
available... but the STRING compiled down to some right nasty
machine-code. That changed with IGYCRCTL, though.

>In scenarios like this, I had always used code snips like
>the one I posted here.

A lot of other folks haven't done that... and a lot of other folks have
been met with a single-line response of 'Please do your own homework.'

>I was just wondering if this was going to garner
>the optimal performance or if the original author knew something I did
>not. So - I put the question out there for folks with more knowledge
>than myself:

.... and you wound up gettin my reply... ah well, worth double what I've
asked to be paid for it.

>
>Thanks for the suggestion, and your code snip makes perfect sense.

Breaking into the Holiday Cheer, are you... and at this hour of the day!
Glad to have been of assistance.

[top-posting snipped]

DD
.



Relevant Pages

  • Re: UNSTRING performance issue
    ... > Workwork can take the form of homework... ... I had always used code snips like ... > A lot of other folks haven't done that... ... And your reply actually gave me an explanation that makes sense, ...
    (comp.lang.cobol)
  • Re: UNSTRING performance issue
    ... >> Workwork can take the form of homework... ... I had always used code snips like ... >> A lot of other folks haven't done that... ... >And your reply actually gave me an explanation that makes sense, ...
    (comp.lang.cobol)
  • Re: Norton Resistance Question
    ... I was picking other folks brains. ... getting others to do their homework. ... Since technical people usually depend on the work of others, incompetent ... So we do all we can to encourage such folks to quit tech school and go be ...
    (sci.electronics.basics)
  • Re: Help
    ... Where are you stuck? ... If folks are to help you with what is clearly homework, ... Custom MS Office productivity solutions ...
    (microsoft.public.excel.misc)