Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Creating Delimited file removes leading blanks
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Creating Delimited file removes leading blanks
 Login/Join
 
Member
posted
I need to create a delimited flat file. The POL_NUM column has a character format that contains right justified numeric values. I would like to retain the leading blanks. When I run the following the values in POL_NUM become left justified. Any suggestions other than coding the bar delimiters manually?
Thanks

TABLE FILE POLTEST
SUM
INSD
BY POL_NUM
BY TERM_EFF
ON TABLE HOLD AS Pol_Extract FORMAT DFIX DELIMITER '|'
END

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


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 2 | Registered: August 31, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
Do you also want to keep the trailing blanks ?

Either way, you may have to create the file manually.

DEFINE FILE POLTEST
Pipe/A1 = '|' ;
END
TABLE FILE POLTEST
SUM 
Pipe
INSD
BY POL_NUM
BY Pipe
BY TERM_EFF
ON TABLE SAVE AS Pol_Extract
END


Or create a string by concatenating the values together and write the output to a file.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6124 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Thanks, Waz... I figured that would be the answer Smiler


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 2 | Registered: August 31, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Have you tried specifying right-justication in the output, either with function RJUST or with dynamic formatting?

TABLE FILE POLTEST
 SUM
  INSD
  COMPUTE POL_NUM_R/A?? = RJUST(??,POL_NUM,'A??');
 BY POL_NUM/R
 BY TERM_EFF
 ON TABLE HOLD AS Pol_Extract FORMAT DFIX DELIMITER '|'
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Reply With QuoteReport This Post
<JG>
posted
Are you sure that your source file actually contains a right justified alpha column?

Format DFIX, COM, TAB etc. do not strip leading spaces from alpha columns.

They do strip trailing spaces from alpha columns and leading spaces from numeric’s.

If it is stripping leading spaces from alpha columns then either the column is not right justified or
It’s a bug in the version of WF you are running.


 
FILEDEF HOLDA DISK c:\TEMP\HOLDA.ftm
-RUN
DEFINE  FILE CAR
COUNTRYA/A25= '     '| COUNTRY;
CARA/A30=RJUST(16,CAR,'A30');
NUMBER/A9= '    12345';
END
TABLE FILE CAR
PRINT  COUNTRYA CARA NUMBER 
ON TABLE HOLD AS DATA
END
-RUN
TABLE FILE DATA
PRINT *
ON TABLE HOLD AS HOLDA FORMAT DFIX DELIMITER '|'
END
-RUN 

generates

     ENGLAND|          JAGUAR|    12345
     ENGLAND|          JENSEN|    12345
     ENGLAND|         TRIUMPH|    12345
     JAPAN|          DATSUN|    12345
     JAPAN|          TOYOTA|    12345
     ITALY|      ALFA ROMEO|    12345
     ITALY|        MASERATI|    12345
     W GERMANY|            AUDI|    12345
     W GERMANY|             BMW|    12345
     FRANCE|         PEUGEOT|    12345  
 
Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Creating Delimited file removes leading blanks

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.