Focal Point
[SOLVED] What is the max length of alpha field?

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

October 26, 2020, 12:01 PM
Henry Ma
[SOLVED] What is the max length of alpha field?
Sorry in advance, if this question has already been posted. I just couldn't find it.

I'd like to make a table available in WebFOCUS.
Unfortunately, there are fields on the table that contain 6000+ characters (like a comment field). Potentially, I may need to drop one of these fields onto a report, so I'm wondering what problems I would cause or if this is even possible.

thanks!

This message has been edited. Last edited by: FP Mod Chuck,
October 26, 2020, 01:52 PM
MartinY
The problem may be more regarding the targeted output and available spaces on the report.
Printing/displaying 6K+ characters may be a pain...


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 26, 2020, 04:11 PM
Waz
Alpha fields can go to 8k, but I would suggest a 4k limit.

The next option is to use TX fields. They handle fields like clobs. Check it out in the documentation


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

October 27, 2020, 09:13 AM
Henry Ma
Thanks for the thoughts, it's very helpful! I'll have try some things, but... if someone can point to me where in the docs it shows the maximum length of an alpha (or tx) field that would be awesome!
October 27, 2020, 04:26 PM
John_Edwards
Best of luck finding that. I've used 3000 as my top limit in the past, and wanted to go higher. (This was in version 7.6.) I could not find official documentation, and found I had issues slinging the fields around above 3000.



October 27, 2020, 05:02 PM
Waz
What version of WebFOCUS are you on ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

October 28, 2020, 02:28 PM
dbeagan
Describing Data With WebFOCUS Language Release 8206 Page 146 states that "you can have up to 4096 bytes in an XFOCUS file segment."
But this may be out of date because this works fine:
TABLE FILE car
  PRINT COUNTRY
COMPUTE FLD_A100  /A100   = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890';
COMPUTE FLD_A1000 /A1000  = FLD_A100   | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100;
COMPUTE FLD_A10000/A10000 = FLD_A1000  | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000;
COMPUTE Comment   /A16280 = FLD_A10000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A100  | FLD_A100  | '12345678901234567890123456789012345678901234567890123456789012345678901234567890';
ON TABLE HOLD AS foccache/test FORMAT XFOCUS
END  

I can pull data into a report for the Comment field. Then if the Comment field is increased to A16281 there is an error message:
ERROR AT OR NEAR LINE      8  IN PROCEDURE xfocus_max_field_size
(FOC36381) SEGMENT SIZE FOR 'field Comment' EXCEEDS LIMIT OF 16280

Adapter Administration WebFOCUS Reporting Server Release 8206 Page 1418 indicates that with the SQL Server adapter you can have has long as A8000.
Trying this out, it does seem to work. (Note to run this test, your reporting server would need to be able to create table on SQL Server):

SET HOLDLIST = PRINTONLY
APP HOLDMETA foccache
TABLE FILE car
  PRINT COUNTRY NOPRINT
COMPUTE FLD_A100  /A100  = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; NOPRINT
COMPUTE FLD_A1000 /A1000 = FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100; NOPRINT
COMPUTE Comment   /A8001 = FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 ;
ON TABLE HOLD AS testsqlmss FORMAT SQLMSS
END  

Then if I increase the field to Comment/A8001 an error appears:
 (FOC1400) SQLCODE IS 131 (HEX: 00000083) XOPEN: 42000
 : Microsoft SQL Server Native Client 11.0: [42000] The size (8001) given t
 : o the column 'Comment' exceeds the maximum allowed for any data type (80
 : 00).

Page 1788 indicates a max of A4000 for Oracle.
Page 522 indicates a max of A32768 for DB2.

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


WebFOCUS 8.2.06
October 28, 2020, 05:17 PM
vaayu
I could be wrong but I remember the limit being 32K for alpha.


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
October 28, 2020, 05:25 PM
Waz
One thing that needs to be kept in mind, is what is being done with the field.

If you are applying a function to it, what does the function support.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

October 28, 2020, 05:43 PM
Henry Ma
thanks dbeagan!

[QUOTE]Originally posted by dbeagan:
Describing Data With WebFOCUS Language Release 8206 Page 146 states that "you can have up to 4096 bytes in an XFOCUS file segment."
But this may be out of date because this works fine:
TABLE FILE car
  PRINT COUNTRY
COMPUTE FLD_A100  /A100   = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890';
COMPUTE FLD_A1000 /A1000  = FLD_A100   | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100;
COMPUTE FLD_A10000/A10000 = FLD_A1000  | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000;
COMPUTE Comment   /A16280 = FLD_A10000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A100  | FLD_A100  | '12345678901234567890123456789012345678901234567890123456789012345678901234567890';
ON TABLE HOLD AS foccache/test FORMAT XFOCUS
END  

I can pull data into a report for the Comment field. Then if the Comment field is increased to A16281 there is an error message:
ERROR AT OR NEAR LINE      8  IN PROCEDURE xfocus_max_field_size
(FOC36381) SEGMENT SIZE FOR 'field Comment' EXCEEDS LIMIT OF 16280

Adapter Administration WebFOCUS Reporting Server Release 8206 Page 1418 indicates that with the SQL Server adapter you can have has long as A8000.
Trying this out, it does seem to work. (Note to run this test, your reporting server would need to be able to create table on SQL Server):

SET HOLDLIST = PRINTONLY
APP HOLDMETA foccache
TABLE FILE car
  PRINT COUNTRY NOPRINT
COMPUTE FLD_A100  /A100  = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; NOPRINT
COMPUTE FLD_A1000 /A1000 = FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100  | FLD_A100; NOPRINT
COMPUTE Comment   /A8001 = FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 | FLD_A1000 ;
ON TABLE HOLD AS testsqlmss FORMAT SQLMSS
END  

Then if I increase the field to Comment/A8001 an error appears:
[code]
(FOC1400) SQLCODE IS 131 (HEX: 00000083) XOPEN: 42000
: Microsoft SQL Server Native Client 11.0: [42000] The size (8001) given t
: o the colum
October 28, 2020, 05:45 PM
Henry Ma
thanks Waz!
quote:
Originally posted by Waz:
One thing that needs to be kept in mind, is what is being done with the field.

If you are applying a function to it, what does the function support.