On 7/16/2014 9:59 AM, Steve Hobson wrote:
From: Steve Comstock <[email protected]>
To: [email protected],
Date: 16/07/2014 16:23
Subject: Re: EDit mask for floating minus (negative)
Sent by: IBM Mainframe Assembler List <[email protected]>

On 7/16/2014 9:01 AM, [email protected] wrote:
IBM Mainframe Assembler List <[email protected]> wrote
on
07/16/2014 10:50:31 AM:

From: Steve Hobson <[email protected]>

1st operand -  PWORK   DC   X'4020206B212020'

Can I recommend more readable (IMHO) EDIT patterns, Something like:

DIGIT   EQU  X'20'
SIG     EQU  X'01'

PWORK   DC   0CL7,AL1(C' ',DIGIT,DIGIT,C',',DIGIT+SIG,DIGIT,DIGIT)

There was a time I would have pooh-poohed this.  However in this day
and
age when we are trying to train new people to use assembler and
support
old (and very old) assembler programs before we retire or expire, I
wonder
if anyone on the list who is new(er) to assembler would comment on the
readability of this construct.

Well, I'm a little newer than you. :-)

Overall, I like it, but why not complete it with something like:

PWORK  DC   0CL7,AL1(Fill,Digit,Digit,Comma,Digit+Sig,Digit,Digit,Sign)

Sorry about the nit-picks but:
- You might want different fill in different edit patterns. So I prefer C'
'
or Space (defined with Space EQU C' ') similar to your Comma.
- If you need the implied length at all then you'd need 0CL8, if not then
you
don't need the 0CL7.

Right, I was just building on your example, forgot to adjust the length.

OTOH:
- Not sure what Sign is in your example.

Probably:

Sign  dc  c'-'

based on the thread about having a minus sign message character
in the edit pattern.




-Steve Comstock



Were it my task, I would write a macro to build the edit pattern but
that
abstracts the programmer from fundamental knowledge which they should
eventually learn if they are to master assembler.  Of course this has
been
done.  It is called an HLL such as Cobol.
I used to be a fan of macros. But I have many years working with code I
didn't
write that uses macros I didn't write either. Often the macros have little
or
no documentation or code commentary. Even when the macros are documented,
the
documentation is an extra thing I need to find and look at. Nowadays I
prefer
working with code where the source says it all.
And when writing code I attempt to do as I would be done by.

For reference I was at my 55th high school reunion this past weekend
and
am in my 47th year of assembler.
Me too! (47th year of Assembler, not 55th high school reunion.)

Brgds, Steve H.
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Reply via email to