Focal Point
[SOLVED] MATCH Command SORT BY ISSUE

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2701077103

October 06, 2008, 11:21 AM
Robing9
[SOLVED] MATCH Command SORT BY ISSUE
Hi all

I am trying to MERGE two data Sources using the "MATCH" Command it seems not working. Need help big time!!!!!!!!!!!!!!!!!
The issue is the Field by which i am MERGING "STK_NBE" column in one source is of "A18" format and the other is "A8".

STK_NEB = '100011' --- Sample data Source with "A8" format
STK_NEB = '000000000000100011' ----- Same data in the "A18" fromat.

For MATCH Both STK_NEB Should be in the same format. So i did a
"SET ASNAMES =ON
DEFINE FILE STK
LDZ/D8.2S=EDIT(STK_NEB);
AG/A8=FTOA(LDZ, '(D8c)', AG);"

To convert STK_NEB column in "A18" Fromat to "A8". But the solution seems not working. The coverted STK_NEB field data (AG calculated field)is printing properly (as 100011 for sample Data) but not working with MATCH. The result is shown below.

PAGE 1

STK_NEB Descr. DESC_TEXT
100011 CRANBE *****
100011 ***** CRANE
100011 ***** CRANE

This message has been edited. Last edited by: Robing9,


7.6, Unix, HTML
October 06, 2008, 11:35 AM
GinnyJakes
Can you post your code between the code tags (red carats on the right)? What you are doing sounds right.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
October 06, 2008, 12:04 PM
Francis Mariani
Just curious why you would use EDIT and FTOA to convert the A18 column to an A8 column?

I would use Substring:

SUBSTR(inlength, parent, start, end, sublength, outfield)

AG/A8 = SUBSTR(18, STK_NEB, 11, 18, 8, 'A8');



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 06, 2008, 03:35 PM
FrankDutch
Why not convert them both in I8?

And if possible in the master file.
(This only would work if the real data is in fact numeric)




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

October 07, 2008, 12:45 AM
Robing9
hi all

Sloved atlast. Insted of using
  
SET ASNAMES =ON
DEFINE FILE STK
LDZ/D8.2S=EDIT(STK_NEB);
AG/A8=FTOA(LDZ, '(D8c)', AG);
END


I used

 
SET LEADZERO=OFF
TABLE FILE STK
PRINT
     COMPUTE AG/A8 = TRIM('L', STK_NEB, 18, '0', 1, 'A8');
     STK_INFO
ON TABLE HOLD AS SPDATA
END


Then use the HOLD file in the Merge it works. But still not sure why the previous way it didnt work.


7.6, Unix, HTML
October 07, 2008, 02:01 AM
Tony A
I'd pay a visit to your "data designers" if I were you and preach the benefits of "same name same format" especially when key fields are involved - oh wait - perhaps they've not had training Wink

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
October 07, 2008, 09:54 AM
Robing9
Hi all

Found the reason why it didn't work with
SET ASNAMES =ON
DEFINE FILE STK
LDZ/D8.2S=EDIT(STK_NEB);
AG/A8=FTOA(LDZ, '(D8c)', AG);
END  


After the define we have to give a COMPUTE in the TABLE level.
COMPUTE STK_NEB1/A8 = RJUST(8,AG,STK_NEB1);


in both the MERGE tables.(This is to align the data in the SORT BY Field properly).

NOw run the procedure it will work Smiler

in


7.6, Unix, HTML