I tried searching the documentation for this but couldn't find anything. I have output in which some of the columns are start and end dates. I formatted them YY-M-D. When output is to html the dashes remain. When I switch output to format comma for a csv file, it gets rid of the dashes in my file. Why is this and how do I keep it from doing this?
malindaThis message has been edited. Last edited by: Malinda,
WebFOCUS 7.6.11 Windows all output (Excel, HTML, PDF)
May 11, 2010, 10:30 AM
Prarie
This is from the IBI site...may shed some light on your situation.
Smart Date fields will only store the numeric part of the date with no formatting. When the date shows up in a styled report (HTML/PDF), the dates is printed with formatting. Since a data hold file (CSV/ALPHA) is a data file and not a formatted output, you are seeing just the 20090903 value.
There is a function called DATETRAN which will convert a smart date to an alpha translation of the date. See this example:
DEFINE FILE CAR RUN_DATE/MDYY=&MDYY; DATE2/A10=DATETRAN(RUN_DATE, '(MDYY)', '(-)', 'EN', 10, DATE2) END TABLE FILE CAR PRINT RUN_DATE DATE2 BY COUNTRY ON TABLE HOLD AS CSVDATE FORMAT COM END
This will convert the smart date RUN_DATE to a translated alpha date that uses dashes for the delimitter.
If this is run and the output file is viewed with a text editor (like notepad), the dashes will be seen. If the CSV file is opened using Excel, however, Excel will apply it's own formatting for the date field.
In Focus since 1993. WebFOCUS 7.7.03 Win 2003
May 11, 2010, 10:33 AM
njsden
Date separators seem to be stripped out when sent to a COMM/COMMT file. Try creating your own formatted "date" as an alpha field with all the pieces you need. It requires more work, I know, but it may be the way to go unless there is some setting out there of which I'm not aware.
Oh, Prarie just beat me ! Malinda, Prarie's example clearly explains and shows the fact that you need to make your date an alpha field and then you'll have full control.