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



When I was working, I had a co-worker who would always be my "rubber ducky" and I hers. Served us well.

https://rubberduckdebugging.com/

Roger Harman
COMMON Certified Application Developer - ILE RPG on IBM i on Power



-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jeff Crosby
Sent: Wednesday, June 22, 2022 4:21 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Data Structure Issue

I cannot tell you how many times I've struggled with a problem at the end
of the day beating my head against the wall, so I leave it till the next
morning, at which time it practically jumps off the page at me.


On Wed, Jun 22, 2022 at 6:04 AM Jerry Adams <midrange@xxxxxxxx> wrote:

It is said that, when one has a problem that is "too much" one should go do
something else for awhile and then come back to the conundrum so I made the
bed, ytook out the trash, and a few other chores. No luck seeing the
forest
for the trees so I posted my issue.

Later I went outside (in this sweltering heat) on my deck to smoke some
cigars and swill some Jack Daniels. Halfway through the second cigar I
would have done a face palm if my hands had been free.

If I had posted the entire program, Jon, you would have seen it instantly.
I did include the clue "procedure". The DS was in a procedure so the
variable defined there are "local". I usually include things like this in
the main body. I don't know why I didn't this time.

Sorry for the wild goose chase.

Jerry C. Adams
4 out of 3 people struggle with math.
IBM i Programmer/Analyst
--
NMM&D
615-585-2175

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
Jon
Paris
Sent: Tuesday, June 21, 2022 12:32 PM
To: RPG programming on IBM i
Subject: Re: Data Structure Issue

Jerry - is it possible you are missing a PTF or two? I just ran a version
of your code and it worked as expected.

This is the actual RPG code I used: Couldn't be bothered to work out the
fixed form F-spec!

Dcl-F Play WORKSTN;
D DS
D GL# 13s 0
D comp 2s 0 Overlay(gl#)
D div 2s 0 Overlay(gl#:*Next)
D dept 2s 0 Overlay(gl#:*Next)
D acct 4s 0 Overlay(gl#:*Next)
D sub 3s 0 Overlay(gl#:*Next)

GL# = 1234567890123;
Exfmt Testrec;
*InLr = *On;

And this is the DDS

A R TESTREC

A 17 4'Comp'
A 17 9'Div'
A 17 13'Dept'
A 17 18'Acct'
A 17 23'Sub'


A COMP 2 0O 18 5
A DIV 2 0O 18 10
A DEPT 2 0O 18 14
A ACCT 4 0O 18 18
A SUB 3 0O 18 23

All done with VS Code too!
On Jun 21, 2022, at 10:00 AM, Jerry Adams <midrange@xxxxxxxx> wrote:

First, please bear with me; at least the part that has to use
fixed-format
D-specs. The company will not pop for RDi so I'm stuck with SEU which
does
not like free-format F- and D-specs.



Second, we are at release 7.4.



Now for the problem. I am writing a pretty simple inquiry into a control
table. The original developer defined the General Ledger distribution in
a
single field. To make things more readable for the client I decided to
break out the different parts into the fields.



On the display file I have this defined as:



16 4'G/L Distribution'

DSPATR(UL)

17 4'Comp'

17 9'Div'

17 13'Dept'

17 18'Acct'

17 23'Sub'

COMP 2 0O 18 5

DIV 2 0O 18 10

DEPT 2 0O 18 14

ACCT 4 0O 18 18

SUB 3 0O 18 23



Originally, I coded the procedure that outputs the format as



D DS

D GL# 13s 0

D comp 2s 0 Overlay(gl#)

D div 2s 0 Overlay(gl#:*Next)

D dept 2s 0 Overlay(gl#:*Next)

D acct 4s 0 Overlay(gl#:*Next)

D sub 3s 0 Overlay(gl#:*Next)



With



gl# = stxgl#;



where STXGL# is the G/L distribution in the control table. But when I
tested the program, the COMP, etc., fields all came out as *Zeros. I put
the program under debug , and everything showed the values that I
expected,
not *Zeros.



Puzzled was I. Anyway, I changed the DS spec to use subfields prefixed
with
a 'q' and, then, added the following code to the procedure:



gl# = stxgl#;

comp = qcomp;

div = qdiv;

dept = qdept;

acct = qacct;

sub = qsub;



The program now works as expected. But, since the original program COMP
showed "20" when I debugged the procedure, why did it not work? Probably
something really obvious that I cannot see, but bear in mind that I am
blind
in one eye and wear glasses for the other one.





Jerry C. Adams

To me "Drink Responsibly" means don't spill it.

IBM i Programmer/Analyst

--

NMM&D

615-585-2175



--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Frpg400-l&amp;data=05%7C01%7C%7C22a32a435de346800dbc08da54415e17%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637914936976690175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=kU%2BDXdcAiPsv1OzAD3y1r61%2B7ixfO0QlmFZE23Y4Ppo%3D&amp;reserved=0
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Frpg400-l&amp;data=05%7C01%7C%7C22a32a435de346800dbc08da54415e17%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637914936976690175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=WTvH1zuRAqI08d7WJ%2BZTV3v80jmgX6UREPJy2o7wq48%3D&amp;reserved=0.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Famazon.midrange.com%2F&amp;data=05%7C01%7C%7C22a32a435de346800dbc08da54415e17%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637914936976690175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=HsaWNfxvOzEAKaVEv%2BXzgwA3RksoeWmwNMvaD1B8hzY%3D&amp;reserved=0

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Frpg400-l&amp;data=05%7C01%7C%7C22a32a435de346800dbc08da54415e17%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637914936976690175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=kU%2BDXdcAiPsv1OzAD3y1r61%2B7ixfO0QlmFZE23Y4Ppo%3D&amp;reserved=0
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Frpg400-l&amp;data=05%7C01%7C%7C22a32a435de346800dbc08da54415e17%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637914936976690175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=WTvH1zuRAqI08d7WJ%2BZTV3v80jmgX6UREPJy2o7wq48%3D&amp;reserved=0.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Famazon.midrange.com%2F&amp;data=05%7C01%7C%7C22a32a435de346800dbc08da54415e17%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637914936976690175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=HsaWNfxvOzEAKaVEv%2BXzgwA3RksoeWmwNMvaD1B8hzY%3D&amp;reserved=0

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Frpg400-l&amp;data=05%7C01%7C%7C22a32a435de346800dbc08da54415e17%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637914936976690175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=kU%2BDXdcAiPsv1OzAD3y1r61%2B7ixfO0QlmFZE23Y4Ppo%3D&amp;reserved=0
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Frpg400-l&amp;data=05%7C01%7C%7C22a32a435de346800dbc08da54415e17%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637914936976690175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=WTvH1zuRAqI08d7WJ%2BZTV3v80jmgX6UREPJy2o7wq48%3D&amp;reserved=0.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Famazon.midrange.com%2F&amp;data=05%7C01%7C%7C22a32a435de346800dbc08da54415e17%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637914936976690175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=HsaWNfxvOzEAKaVEv%2BXzgwA3RksoeWmwNMvaD1B8hzY%3D&amp;reserved=0




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.