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



"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 10/31/2019
11:02:41 AM:
couldn't figure it out Dave...


This is untested, but the idea is sound. You could have
definitions similar ot the following to parse all the data out of your
trigger buffer.

d char_area ds 260
d varchar2_data 256a overlay(char_area:1) varying(2)
d varchar4_data 256a overlay(char_area:1) varying(4)
d zoned_data 31s 0 overlay(char_area:1)
d packed_data 31p 0 overlay(char_area:1)
d bigint_data 20i 0 overlay(char_area:1)
d integer_data 10i 0 overlay(char_area:1)
d smallint_data 5i 0 overlay(char_area:1)

d trigger_buf s 1000a
d field_type s 2a
d field_pos s 5p 0
d field_bytlen s 5p 0
d field_digits s 5p 0
d field_scale s 5p 0

Then you would have code similar to the following to handle all of
these types of data -- but like I said, it is untested so it may need some
adjustments.

select; // using psuedo field types just for demonstration
when field_type = 'A';
char_area = %subst(trigger_buf:field_pos:field_bytlen);
dsply char_area;
when field_type = 'V2';
char_area = %subst(trigger_buf:field_pos:field_bytlen+2);
dsply varchar2_data;
when field_type = 'V4';
char_area = %subst(trigger_buf:field_pos:field_bytlen+4);
dsply varchar4_data;
when field_type = 'Z';
zoned_data = zero;
%subst(char_area:%size(zoned_data)-field_bytlen+1:field_bytlen)
= %subst(trigger_buf:field_pos:field_bytlen);
dsply zoned_data; // adjust decimal position if needed
when field_type = 'P';
packed_data = zero;
%subst(char_area:%size(packed_data)-field_bytlen+1:field_bytlen)
= %subst(trigger_buf:field_pos:field_bytlen);
dsply packed_data; // adjust decimal position if needed
when field_type = 'B';
char_area = %subst(trigger_buf:field_pos:field_bytlen);
dsply bigint_data;
when field_type = 'I';
char_area = %subst(trigger_buf:field_pos:field_bytlen);
dsply integer_data;
when field_type = 'S';
char_area = %subst(trigger_buf:field_pos:field_bytlen);
dsply smallint_data;
endsl;


Sincerely,

Dave Clark

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.