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]Extract year from the date amper variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Extract year from the date amper variable
 Login/Join
 
Guru
posted
Hi,

Iam using sql passthrough and later Iam trying to read the amper variables and one among those amper variable is a date field which looks something like this:
&date=2011001

I need to extract only the year part from this date amper variable and I was not successful in getting this done using either the Edit nor other date functions.

Any help on how to do this would be much appreciated!

Thanks a lot in advance!

Regards!

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


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Master
posted Hide Post
There are multiple options available. Since it is from DB, default column format will be in date. So either use DB functions to extract year from date and then read it in WebFOCUS or you can use WF functions to convert Date format to alpha and then read into amper variable.

I prefer DB conversion as it is simple and straight forward .
Thanks,
Ram
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Guru
posted Hide Post
Hi Ram,

Thanks a lot for the quick response but I actually cannot change it in the DB.
Is there any other ways to get it done in Webfocus.

Any sample example on this might be helpful.

Thanks a lot!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Guru
posted Hide Post
Hi,

The format of the field is D20.2 and not date.

Regards1


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Guru
posted Hide Post
I got the solution!Thanks!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Master
posted Hide Post
You can try either of these.
-SET &DATE_YYMD=20141225;
-SET &DATE_YY=&DATE_YYMD/10000;
-TYPE DATE_YY - &DATE_YY
-EXIT
TABLE FILE CAR
SUM
COMPUTE DATE_YYMD/D20.2=20141225; NOPRINT
COMPUTE DATE_YY/I4=DATE_YYMD/10000;
BY HIGHEST 1 COUNTRY NOPRINT
ON TABLE HOLD FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
END
-RUN
?FF HOLD
-READ HOLD &DATE_YY.A4.
-TYPE DATE_YY - &DATE_YY

 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Guru
posted Hide Post
Hi,

Thanks a lot Ram.It helped!

Regards!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report 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]Extract year from the date amper variable

Copyright © 1996-2020 Information Builders