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



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




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.