|
-----Original Message-----
From: bmorris@ca.ibm.com <bmorris@ca.ibm.com>
To: MIDRANGE-L@midrange.com <MIDRANGE-L@midrange.com>
Date: Friday, August 13, 1999 12:14 PM
Subject: Re: Floating Point Question
>Blobs ... you need embedded SQL to get that data out. RPG itself can't see
the
>blob data.
>
>Barbara Morris
You mean there won't be anything in the trigger buffers? Will changes to
the blob even fire a trigger?
>
>----------------------------------------------------
>Here's a little toy program I wrote a while ago that uses lbcpynv to
convert
>from packed to zoned:
>
>D DPA_Template DS based(pDPA_Template)
>D DPA_type 1A
>D DPA_len 5I 0
>D DPA_frac 1A overlay(DPA_len:1)
>D DPA_digit 1A overlay(DPA_len:2)
>D DPA_res 10i 0
>D T_ZONED C x'02'
>D T_PACKED C x'03'
>
>D cpynv pr extproc('_LBCPYNV')
>D tgtNum * VALUE
>D tgtAttr LIKE(DPA_Template)
>D srcNum * VALUE
>D srcAttr LIKE(DPA_Template)
>
> * If you are on V4R4 or later, you can use 3U 0 for the
> * frac and digit values and set the values directly
> * in the template without using this binchar stuff.
>D ds
>D bin 5i 0
>D binchar 1a overlay(bin:2)
>
>D packedDesc S LIKE(DPA_Template)
>D zonedDesc S LIKE(DPA_Template)
>
> * Sample data
>
>D p DS
>D pval 7P 3 inz(-1234.567)
>D s DS
>D sval 7S 3 inz(*hival)
>
> * Setup the packed descriptor
>C eval pDPA_Template = %addr(packedDesc)
>C eval DPA_Template = *allx'00'
>C eval DPA_Type = T_PACKED
> * Setup the length part
>C eval bin = %len(pval)
>C eval DPA_digit = binChar
>C eval bin = %decpos(pval)
>C eval DPA_frac = binChar
> * Setup the zoned descriptor like the packed one
>C eval zonedDesc = packedDesc
>C eval pDPA_Template = %addr(zonedDesc)
>C eval DPA_Type = T_ZONED
> * Convert from packed to zoned
>C callp cpynv(%addr(s) : zonedDesc :
>C %addr(p) : packedDesc)
> * Debugger: ===> EVAL sval:x F1F2F3F4 F5F6D7
>C return
>
>
>>From QSYSINC/MI H, members MICPTCOM and LBCPYNV:
>
> typedef _Packed struct _DPA_Template_T {
> /* Data Pointer Attr template */
> char Type; /* Scalar type */
> short Length; /* Scalar length: */
> /* 0-7 = fractional digits */
> /* (zoned or packed) */
> /* 8-15 = total digits */
> int reserved; /* reserved for future use */
> /* and must be set to zero */
> } _DPA_Template_T;
> #define _T_SIGNED 0x00
> #define _T_FLOAT 0x01
> #define _T_ZONED 0x02
> #define _T_PACKED 0x03
> #define _T_CHAR 0x04
> #define _T_ONLYNS 0x06
> #define _T_ONLYN 0x07
> #define _T_EITHER 0x08
> #define _T_OPEN 0x09
> #define _T_UNSIGNED 0x0A
>
> void _LBCPYNV ( _SPCPTR, /* Receiver *
> _DPA_Template_T *, /* Receiver attributes *
> _SPCPTRCN, /* Source *
> _DPA_Template_T * ); /* Source attributes *
>
Whoa! You lost me about two paragraphs up. My little bit-counting routine
is not this long. Could you just wrapper this in a procedure called
CvtPackToZone() ? I don't think I really want to know how it works. What's
that old saying about politics and sausage?
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.