Note that --- RETURN CODE is a 32bit field and only the bytes explicitly returned by the Windows function should be examined. The remaining byte(s) will contain undefined values. For example, if the Windows funtion returns a short integer (16 bits), only the first 16 bits will contain the return code, the remaining 16 bits are undefined. To do this, define a working storage file that contains a numeric field defined by the domain 0LA RET CODE. This gives your numeric field the same characteristics as --- RETURN CODE, ie, a 32 bit binary number. Now put a group field around your numeric field so that you can refer to it by the group name. When moving group fields, Appx does not try to convert types, it simply does a byte by byte copy, which is what we want. Now you can define additional group fields, breaking down the 4 bytes in different ways. For example:
<div id="_mcePaste"> Dsp -Opts--</div>
<div id="_mcePaste">Seq No Field Name Field Type Seq Format T DL AA </div>
<div id="_mcePaste">100 RET CODE FULL GROUP HEADER </div>
<div id="_mcePaste">200 RET FULL DOMAIN AA</div>
<div id="_mcePaste">500 RET CODE FULL END GROUP TRAILER</div>
<div id="_mcePaste">600 RET CODE SHORT GROUP HEADER</div>
<div id="_mcePaste">700 RET S1 NUMERIC 9(5) Oc 2 AA</div>
<div id="_mcePaste">800 RET CODE SHORT END GROUP TRAILER</div>
<div id="_mcePaste">900 RET CODE BOOL GROUP HEADER</div>
<div id="_mcePaste">1000 RET BOOL NUMERIC 9(3) Oc 4 AA</div>
<div id="_mcePaste">1100 RET CODE BOOL END GROUP TRAILER</div>
<div id="_mcePaste">1200 RET BYTES GROUP HEADER</div>
<div id="_mcePaste">1300 RET BYTE ALPHA X(1) Oc 4 AA</div>
<div id="_mcePaste">1400 RET BYTES END GROUP TRAILER</div> |