On 14/10/2010 3:07 PM, Newton, Ernie wrote:
Ernie,
Not impossible at all. I will assume some certain details here, and
there are a multitude of ways to do this and the more recent versions of
Suprtool have the $number function which takes any free form number and
can covert it.
The first step would be to get the data coerced to the proper format
before putting to the db so here are some ways to do that step:
in somefile
{define the space}
define numtoconv,97,4,display
{define the target field}
define target,1,4,packed
{extract to the target}
extract field1
extract field2...
extract target=numtoconv
extract field10
out tobeput,link
xeq
From your example it looks as though the data would be 7700, but you
want to have it be 7700, so the extract statement could be:
extract target=numtoconv * 1000
Of course the devil is in the details and their may be other examples of
data that won't coerce but given the information this should work.
Neil Armstrong
Robelle
> Greetings,
> I have a data item in an Image dataset that is defined as P8.
> I have a file that I want to PUT to the dataset and starting at byte 97 is where the P8 data resides.
> The input file is pure ASCII and the value at byte 97 is "77 ". I want that value to go into my P8 field as +7700000.
> Can that be done? I've tried to define that area of my input file as "a,1,4,packed", but the value ends up being 3737303.
> Am I trying to do an impossible task?
> Thanks,
> Ernie
>
> This message, including any attachments, is intended solely for the use of the named recipient(s) and may contain confidential and/or privileged information. Any unauthorized review, use, disclosure or distribution of this communication(s) is expressly prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy any and all copies of the original message.
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
>
--
Neil Armstrong [log in to unmask]
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|