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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
int to alpha
 Login/Join
 
Gold member
posted
I can't possibly be the first person to have this issue. Maybe I'm just ignorant of an easy function to do this.

Here goes:

I want to make an alpha field to say a date range such as
"01/16/2004 to 02/15/2004" but I have to calculate the months. conceptually I want to do:
((month - 1)|'/'|'16/'|year|' to '| month | '15/' | year)

this is clearly not legal since the output needs to be in alpha and I'm doing arithmatic.

is there a way to do this arithmatic and cast it to char inline? it would make sense to me to do something like

(char(month-1)...)

but that doesn't seem like an option.

Can anyone help me out here?
 
Posts: 77 | Location: Chicago, IL | Registered: May 06, 2004Report This Post
<Pietro De Santis>
posted
Something like this?



-DEFAULT &MONTH = 1;
-DEFAULT &YEAR = 2004;

TABLE FILE CAR
PRINT MODEL
COMPUTE MONTH1/I2 =
&MONTH; NOPRINT
COMPUTE MONTH2/I2 =
IF MONTH1 EQ 1 THEN 12 ELSE MONTH1 - 1; NOPRINT
COMPUTE YEAR1/I4 =
&YEAR; NOPRINT
COMPUTE YEAR2/I4 =
IF MONTH1 EQ 1 THEN YEAR1 - 1 ELSE YEAR1; NOPRINT
COMPUTE DATE_INFO/A40 =
EDIT(MONTH2) | '/16/' | EDIT(YEAR2) | ' - ' |
EDIT(MONTH1) | '/15/' | EDIT(YEAR1);

BY COUNTRY
END

This message has been edited. Last edited by: <Mabel>,
 
Report This Post
Gold member
posted Hide Post
Thanks Pietro De Santis!

This worked with some minor differences. Rather than a compute I used a define so I could put it in the header. The code was great though... thanks again Smiler
 
Posts: 77 | Location: Chicago, IL | Registered: May 06, 2004Report This Post
Expert
posted Hide Post
George, since you're putting it all in a header, how about just using smart dates for the 2 dates:
HEADING
"TABLE FILE something
do stuff
BY DATE1 NOPRINT BY DATE2 NOPRINT
END
where the dates are formated
DATE/MtDYY , which is very nice looking
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders