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]Converting an int to a date or alpha

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Closed]Converting an int to a date or alpha
 Login/Join
 
Member
posted
Hi
I tried to convert an integer field(I11) (201501) to an alpha or a date. I need to get the format of January 2015. I tried different functions and nothing seems to work. Can anyone help me. Below is the functions I used to get the date.

COMPUTE PCPYear3 /A4 = EDIT(PGIP_PHYSCIANSLIST,'9999');
COMPUTE PGIP_MONTH/I2 = DTPART(PGIP_PHYSCIANSLIST, MONTH);
COMPUTE PGIP_YEAR/I4 = DTPART(PGIP_PHYSCIANSLIST, YEAR);
COMPUTE PGIPYear1/YYM =PGIP_PHYSCIANSLIST;
COMPUTE PGIPYear = SUBSTR(6,PGIP_PHYSCIANSLIST,1,4,4,'A4');

Thanks,
Sherly
The version I am using is 8.1.05
Windows 7 Enterprise

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


WebFocus 8.x
Hyperstage
 
Posts: 6 | Registered: June 16, 2015Report This Post
Expert
posted Hide Post
DEFINE FILE CAR
MY_INT_FIELD/I11 WITH COUNTRY = 201501;

MY_YYMI/I6YYM = MY_INT_FIELD;
MY_YYM/YYM = MY_YYMI;
END

TABLE FILE CAR
SUM
SALES
MY_INT_FIELD
MY_YYMI
MY_YYM
BY COUNTRY
END


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
Member
posted Hide Post
Hi Francis,
Do I need to hardcode the value of the date?
I tried the code below and the code failed

CStart_DT/I11 WITH PGIP_PHYSCIANSLIST = 201507;
My value should come from the table.

Sherly


WebFocus 8.x
Hyperstage
 
Posts: 6 | Registered: June 16, 2015Report This Post
Platinum Member
posted Hide Post
Hi Sherly,

You might find answers to all those pesky date questions in Almost 1001 Ways to Work with Dates in WebFOCUS -- a handy book filled with examples! Available at www.aviter.com.


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

 
Posts: 191 | Location: Henderson, Nevada | Registered: April 29, 2003Report This Post
Expert
posted Hide Post
Hi Sherly,
Welcome to the WebFOCUS Forum.

Try this:

COMPUTE DATE0/I6YYM = PGIP_PHYSCIANSLIST;
COMPUTE DATE1/A6YYM = EDIT(DATE0);
COMPUTE MONTH_YR/A17 = LCWORD(17, CHGDAT('YYMD','MXYY',DATE1,'A17') ,'A17');


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Member
posted Hide Post
it is working. Thank you so much for your help
Sherly


WebFocus 8.x
Hyperstage
 
Posts: 6 | Registered: June 16, 2015Report This Post
Expert
posted Hide Post
Hi Sherly,

Can you update the title of your first port in this thread to add [CLOSED] or [SOLVED] if you are happy with the answer.


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
Expert
posted Hide Post
"Do I need to hardcode the value of the date"

Sherly, since the CAR file doesn't have a date column, I had to concoct one. Of course the data can come from an existing column.


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
  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]Converting an int to a date or alpha

Copyright © 1996-2020 Information Builders