Focal Point
numbers prepended to char output

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

September 21, 2007, 12:07 PM
MacLonghorn
numbers prepended to char output
I'm trying to grab a person's name from a table and display in HTML:

TABLE FILE CONTACT
PRINT FULLNAME
WHERE ID EQ &ID
ON TABLE SAVE AS FULLNM
END
-RUN
-READ FULLNM &FULLNM.A50
-TYPE &FULLNM

What displays is "000012" prepended to the person's name. "fullname" col is defined as A50V in master file, but it works as A50. Why is this the case?


Thanks.

Mark
WF 7.6 Windows
September 21, 2007, 12:15 PM
Kamesh
I see this issue in the earlier versions.

Try this,

TABLE FILE CONTACT
PRINT FULLNAME
WHERE ID EQ &ID
ON TABLE SAVE AS FULLNM
ON TABLE SET VARCHAR OFF
END
-RUN
-READ FULLNM &FULLNM.A50
-TYPE &FULLNM

Hope this helps,


WFConsultant

WF 8105M on Win7/Tomcat
September 21, 2007, 12:49 PM
Leah
quote:
fullname" col is defined as A50V in master file, but it works as A50. Why is this the case?


If your question is as to the last part, I believe variable character data can be accessed as fixed at the maximum length, I also don't believe that for reporting purposes, focus likes variable character much.


Leah
September 21, 2007, 03:00 PM
MacLonghorn
Using "ON TABLE SET VARCHAR OFF" did not work. I'll just stick to the fixed char solution, unless someone else out there has an idea. Thank you both.


Thanks.

Mark
WF 7.6 Windows
September 25, 2007, 11:03 AM
FrankDutch
Mark

If you do need the varchar field you can either first define an other field like NEWFULL/A50=FULLNAME or you can solve this in the read command, I found that this varchar fields always gives 6 extra characters, so
-READ FULLNM FILL.A6. &FULLNM.A50

will do it.




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

September 25, 2007, 11:22 AM
Tony A
Mark,

A very simple method is to force the output to be a fixed length and then you need not mess around with the -READ -

TABLE FILE CONTACT
PRINT FULLNAME.A50
WHERE ID EQ &ID
ON TABLE SAVE AS FULLNM
END
-RUN
-READ FULLNM, &FULLNM
-TYPE &FULLNM

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 
September 25, 2007, 11:30 AM
FrankDutch
Tony

quote:

PRINT FULLNAME.A50


should this be FULLNAME/A50 ?

and now you get the field two times unless???




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

September 25, 2007, 11:36 AM
Tony A
Frank,

Too true Frank, wondered who would pick up my intentional typo Music Glad to see that you're awake.

And of course I forgot to add ON TABLE SET HOLDLIST PRINTONLY.

I put it down to a dys.. dis... dyslexic keyboard Smiler

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 
September 26, 2007, 09:28 AM
PBrightwell
There is a setting on your WebFocus server that can be used to turn off the varchar option. Unfortunately, I can not remember what it is. Open a case with IBI and ask about it. Functions other than concatenation can be affected by the varchar and give incorrect results.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
September 27, 2007, 08:31 AM
linus
Place this setting in your edasprof
SQL SQLORA SET VARCHAR OFF
This will keep future mfd's from being created with variable length fields.

Also, since the field is defined in the mfd as a AnV, I would define a new field in the mfd to a straight alpha format. If my memory serves me correctly, you can just change the USAGE format to an alpha. Give that a shot, if not define a new field.


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
October 01, 2007, 03:26 AM
GamP
And, if you do need the varchar to be present, you could always read your hold file using DM and skip the 6 bytes that contain the length of the variable. The hold file will be fixed length no matter what.
So:
-READ FULLNM &X.6 &FULLNM.A50

G.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
October 01, 2007, 04:32 AM
FrankDutch
G

That is what I said too, but I never realised that the first six digit gives you the lengt of the characterstring. Interesting to know, and might be usable sometime.!




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