×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Justin,

Looks like Barbara didn't notice that there's an unused byte (positions 15, 22, 29, etc) between the array elements in your I-specs.

But, you can just change the q1 in her example to overlay(elem: 6) to skip that empty position, or still a filler field in between the two.

Alternately, you could try something like this instead:

D elem_t ds qualified
D c1 7p 0
D 1a
D q1 2s 0

D rec ds
D 10a
D elem likeds(elem_t) dim(50)


Then you'd refer to stuff as rec.elem(1).q1, rec.elem(1).c1, etc. I kinda like that approach, for some reason...

-SK


On 10/30/2015 4:33 PM, Barbara Morris wrote:
On 10/30/2015 10:38 AM, Justin Taylor wrote:
I have a non externally-described PF that contains two 50 element
arrays, but they alternate.

Example:
I P 11 14 0C1(1)
I 16 17 0Q1(1)
I P 18 21 0C1(2)
I 23 24 0Q1(2)
I P 25 28 0C1(3)
I 30 31 0Q1(3)
I P 32 35 0C1(4)
I 37 38 0Q1(4)
I P 39 42 0C1(5)
I 44 45 0Q1(5)


I need to declare this PF in a procedure, but I'm not sure the best
way to do it. Any suggestions?


You can define a data structure like this, and then code this data
structure as the result field of your READ operation.

dcl-ds ds;
elem dim(50) pos(11);
c1 packed(7) overlay(elem:*next);
q1 char(2) overlay(elem:*next);
end-ds;

Here's the fixed-form version of the DS.

D ds ds
D elem overlay(ds : 11) dim(50)
D c1 7p 0 overlay(elem : *next)
D q1 2a overlay(elem : *next)


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