Focal Point
[CLOSED]6-digit character count on ALPHA

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

November 21, 2016, 10:53 AM
BigHarryMonkey
[CLOSED]6-digit character count on ALPHA
Is there a better way to remove that automatic character count per line? I'm just grabbing one column from my Stored Procedure ("data"), but if I don't use "DEFINE FILE ADATA/A4000=data", the record has a counter at the beginning of each row. But when I do use DEFINE FILE ADATA/A4000, the text file pads the end with blank spaces to 4000. I can make this smaller than 4000, but some lines will still pad as they're variable lengths. Any help would be appreciated!

-DEFAULT &OUTPUTFormat='ALPHA';

ENGINE SQLMSS SET DEFAULT_CONNECTION Database

SQL SQLMSS EX [WebReport].[dbo].[SP_Name] 'ClientLogin';

SET CENT-ZERO = ON
SET NODATA=' ';
SET DROPBLNKLINE=ON
SET BYDISPLAY=ON

TABLE FILE SQLOUT
PRINT
data
ON TABLE HOLD AS HDATA
END

-*Removes 6-digit character-count from beginning of each row
DEFINE FILE HDATA
ADATA/A4000=data
END

TABLE FILE HDATA
PRINT
ADATA

ON TABLE PCHOLD FORMAT '&OUTPUTFormat.().Output Format.'
ON TABLE SET LINES 999999
ON TABLE SET PAGE NOLEAD
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
END

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8
Windows, All Outputs
November 21, 2016, 11:06 AM
BigHarryMonkey
Nevermind, it's padding spaces to the end regardless of the Define. How do I stop the file from padding? Or can I RTRIM spaces?

Thanks!


WebFOCUS 8
Windows, All Outputs
November 21, 2016, 11:38 AM
Tony A
Try SQL SQLMSS SET VARCHAR OFF instead of double data handling to remove the 6 digits at the beginning of your data string.

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 
November 21, 2016, 11:39 AM
eric.woerle
you can try using a variable length field. field/A4000V. Technically the file will still retain all 4000 spaces as WebFOCUS doesn't have a true variable field type, but the field will record the length of the data and there by not show trailing spaces in the output. If you still have issues with trailing spaces, that means that the field in the database was recorded with trailing spaces. Then you would need to use a trim function on the field. There are examples in the help file for the function.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
December 21, 2016, 02:06 PM
BigHarryMonkey
Thanks guys, I ended up switching to "FORMAT DFIX DELIMITER ' ' HEADER NO". Fortunately I only have one field.


WebFOCUS 8
Windows, All Outputs