×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Hey Kent,
<snip>
We are in the process of revamping our coding standards. Eons ago (and I
still see it today) I saw a few presenters declare all literals in the
<
http://www.amazon.com/gp/product/B0006C9Y3G?ie=UTF8&tag=midrangedotcom&link
_code=em1&camp=212341&creative=380613&creativeASIN=B0006C9Y3G&adid=aa2f38b8-
5931-4696-b190-9eaa9d6133eb> D-specs. One presenter explained why he liked
declaring literals this way,
though I don't remember the reasons given. Now I have been asked to compile
a list of reasons/benefits for declaring literals in the D-specs. If there
are some real benefits to declaring literals this way, then we will make it
part of our standards. If you would be so kind to share your thoughts, I
would appreciate it.
</snip>
Probably already mentioned but - if using d-specs you should be able to
specify your constant literal in UCS2 format:
D MY_CONSTANT c const(%ucs2('MY VALUE'))
Your constant value can then be used in string comparisons, independent of
the ccsid of the job.
Not necessarily something you may need - but if your code is going to run on
different systems with different values for the job ccsid then you may want
to store your constants in a format that is independent of the system you
are running on. Of course, you will have to compare %ucs2(yourString) with
the constant. But it can buy you a lot in some situations.
Cheers
Larry Ducie
As an Amazon Associate we earn from qualifying purchases.