|
Note: The buffer length of 20 should not be confused with how many
_characters_ the field has. The fields have equivalent characters in
length, thus no Substring should be done.
Scenario:
chgjob ccsid(37)
strsql
create table qtemp.p1 (Z numeric (10, 0) not null )
create table qtemp.p2 (G graphic (10) ccsid 13488 not null )
insert into qtemp.p1 values(20070816)
insert into qtemp.p2 values('20070816')
Question: How to join equivalence on Z and G?
select Z ,G
from qtemp.p1 ,qtemp.p2
where char(Z) = G
Regards, Chuck
--
All comments provided "as is" with no warranties of any kind
whatsoever and may not represent positions, strategies, nor views of my
employer
jmoreno@xxxxxxxxxxxxxxxx wrote:
Here is a scenario that I am entertaining and I would like to ask you for
your advice
There are two separate Physical files in our System that unfortunately
cannot be recreated
and we would like to have a Join file built over them.
The first physical file (P1)
-----------------------------
Has a field that is Numeric [Data type= Zoned , Field Length (10, 00
(ten 10 digits and no decimal positions), Buffer length 10]
CCSID = 65335
I will call it Field1
The Second physical file (P2)
------------------------------
Has a field that is type DBCS [Data type = Graphic, Field length 20,
Buffer length 40
CCSID = 13488
I will call it Field 2
Joined (logical) file Or SQL view
----------------------------------
The Joined file should look something like this ...
o The Character portion (10 bytes long) of the first file (P1).Field1
at CCSID = hopefully 37
Joined to
o The SubString - SST, portion of the first (10 bytes) of the second
(P2).Field2 at CCSID = hopefully 37
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
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.