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     [CLOSED]Switching date of birth to an alpha field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Switching date of birth to an alpha field
 Login/Join
 
Platinum Member
posted
This is probably really simple but I cannot get this to work. I am working on a report that needs all fields to be alpha and am outputting csv. My only problem is that date of birth is originally formatted YYMD. I need it to be an alpha field and output as MMDDYYYY. I have tried just redefining this as an alpha field as well as separating out the month, day, and year as alpha fields from the original field using defines and then combining those. Neither is working. Any suggestions?

Thanks,
malinda

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


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Virtuoso
posted Hide Post
Try this:

DATE_ALPHA/A8MDYY = DATE ;


Or, if you don't want the slashes:

DATE_ALPHA/A8M|D|YY = DATE ;

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Platinum Member
posted Hide Post
Would I put this in a define or right in my print list?


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Platinum Member
posted Hide Post
When I try this:
 PRINT
     'CSCUSAKAI.SEG01.LAST_NAME'
     'CSCUSAKAI.SEG01.FIRST_NAME'
     'CSCUSAKAI.SEG01.CSC_EMAIL'
     'CSCUSAKAI.SEG01.USER_TYPE'
     INTERNAL_ID
     'CSCUSAKAI.SEG01.EMPLID'
     'CSCUSAKAI.SEG01.ROLE'
     DATE_ALPHA/A8M|D|YY = CSCUSAKAI.SEG01.BIRTHDATE 


It errors out on the date_alpha.....what am I missing?


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Expert
posted Hide Post
Malinda,

Something like this should work:

FILEDEF H001 DISK test/h001.csv
-RUN
TABLE FILE CENTORD
PRINT
ORDER_NUM
ORDER_DATE/A8MDYY
ON TABLE HOLD AS H001 FORMAT COMMA
END

Since you're creating a HOLD file, those slashes will NOT be in it.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
When I do this,
 PRINT
     'CSCUSAKAI.SEG01.LAST_NAME'
     'CSCUSAKAI.SEG01.FIRST_NAME'
     'CSCUSAKAI.SEG01.CSC_EMAIL'
     'CSCUSAKAI.SEG01.USER_TYPE'
     INTERNAL_ID
     'CSCUSAKAI.SEG01.EMPLID'
     'CSCUSAKAI.SEG01.ROLE'
     DATE_ALPHA/A8M|D|YY
BY 'CSCUSAKAI.SEG01.USERNAME'
HEADING
""
FOOTING
""
WHERE CSCUSAKAI.SEG01.USERNAME NE ' ';
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE * 


I get this,
(FOC002) A WORD IS NOT RECOGNIZED: DATE_ALPHA/A8M|D|YY


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Expert
posted Hide Post
Malinda,

1) You mentioned that you are creating a CSV file, but this latest example shows HTML.
2) DATE_ALPHA/A8M|D|YY is just an example! Please substitute DATE_ALPHA with your real Date field.
3) If you're creating a CSV hold file, then you do not need to exclude slashes with the syntax Dan suggested, you just need to change the arrangement of the date components, which can simply be done with the code I just showed you.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Francis is correct: my DEFINE is not necessary, and removal of the slashes is also not necessary. In addition, DATE/MDYY should also work as an output format (A8MDYY shouldn't be necessary) because WF will convert it to an alpha date without slashes when writing the date to the CSV file.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Platinum Member
posted Hide Post
I was just reading everything a little wrong. Made some changes and it now works. Thanks guys!


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Expert
posted Hide Post
FYI,

If you put this sort of thing in your "print list" then you need the word COMPUTE before it, as you are creating a new field, and the field name does not exist. The command COMPUTE tells WebFOCUS that the next term will create a field of the specified name and format.


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Switching date of birth to an alpha field

Copyright © 1996-2020 Information Builders