could it be that your code (unless you posted it incorrectly) was wrong?
D tidInInt s 5u 0 based(subInInt_p)
D tidInInt_p s * inz(%addr(TID))
shouldn't tidInInt be based on tidInInt_p rather than subInInt_p???
Thanks,
Tommy Holden
From: "hockchai Lim" <lim.hock-chai@xxxxxxxxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxx
Date: 02/05/2010 03:30 PM
Subject: Re: Binary type in physical file that created thru DDS
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
I resolved the problem by doing below (note: The physical file is ECDHDR):
D ECDHDRDS E DS extname(ECDHDR :RECDHDR :*input)
D qualified
D SUBInInt 10u 0 overlay(SUB)
D TIDInInt 5u 0 overlay(TID)
D PHN_OR_PINInInt...
D 20i 0 overlay(PHN_OR_PIN)
when the program does the read, I've it read into the ECDHDRDS structure.
The TIDInInt shows up correctly.
Strange that this work but the other way doesn't
Thanks
"Lim Hock-Chai" <Lim.Hock-Chai@xxxxxxxxxxxxxxx> wrote in message
news:mailman.6808.1265402631.2580.rpg400-l@xxxxxxxxxxxxxxx
I've a physical file that has a field that is declared as such in the
DDS:
A TID 2B 0
Data in this file is added/updated thru a C program. This C program
treats this TID field like it is an unsigned int. Everything works fine
in the C Program. But thing get a bit strange when I try to access it
thru RPG.
In Debug mode, below is what I see in RPG vs. actual hex value:
TID Actual TID Value TID Hex Value
Hex Value In RPG In RPG
0001 1 001F
00C8 0 000F
I think I know why it is doing this, so I did below to try to get around
the problem:
D tidInInt s 5u 0 based(subInInt_p)
D tidInInt_p s * inz(%addr(TID))
But it still did not slove my problem.
x'00C8' in TID is showing as x'006E' in tidInInt. <== This, I'm not
able to explain.
As an Amazon Associate we earn from qualifying purchases.