Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


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

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[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, 2010Report 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.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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, 2010Report 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, 2007Report 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  
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

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

Copyright © 1996-2020 Information Builders