× 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.



I LOVE out-of-tune ukulele!

Now Anna Russell on how to write a G&S opera - THAT is fine stuff!

OK, back to OT - maybe!

On 12/9/2013 5:46 PM, Jon Paris wrote:
I will personally hunt you down and force you to listen to 24 hours of Bach played on an out-of-tune ukulele. Or possibly Gilbert and Sullivan if I'm feeling particularly evil that day.


On 2013-12-09, at 4:47 PM, Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx> wrote:

So are you saying you'll cringe if I call a subprocedure moveLeft4of6()?

:-P

On 12/9/2013 12:54 PM, Jon Paris wrote:
"As grotchy as it is, MOVEL at least hinted that the goal was to extract
some (or all) of one field."

The only hint it gave Buck was that whenever you saw a MOVE of _any_ flavor the only thing you knew for sure was that some data moved somewhere. You knew you had to go study data types and lengths before you knew what was happening. One of many reasons why I always hated the MOVE family and was thrilled when they wed dropped.


On 2013-12-09, at 1:38 PM, Buck Calabro <kc2hiz@xxxxxxxxx> wrote:

On 12/9/2013 11:31 AM, Vernon Hamberg wrote:
I'm looking at some code - the purpose is to put the 1st 4 digits of a
6-digit variable into a 4-digit numeric variable.

It is being done with the MOVEL opcode now.

I'm wondering about efficient alternative methods. One I can think of is
to use a data structure -

dcl-ds dsMoveL qualified;
num4 zoned(4);
num6 zoned(6) pos(1);
end-ds;

Anything simpler? Better performing?
As grotchy as it is, MOVEL at least hinted that the goal was to extract
some (or all) of one field.

If the case is that all rows containing NUM6 need to have the first 4
digits extracted, I favour the data structure. For an example, let's
say I was spinning through post-mortems of my SQL failures. SQLSTATE is
a 5 digit code, the first two of which are the class. 00 is normal, 01
is warning, etc. For nefarious reasons, I'm only interested in the
class, not the detail. Using a data structure makes it crystal clear to
me that the class is a subset of the whole.

I could use division or multiplication to extract the class but that
would be a side effect due to truncation as opposed to the primary
purpose of mathematical division. Decent names would hint at the intent
of division though.

--buck
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Jon Paris

www.partner400.com
www.SystemiDeveloper.com




--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Jon Paris

www.partner400.com
www.SystemiDeveloper.com






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.