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
Convert Date Format
 Login/Join
 
<We_Focus>
posted
Hi All

I Have a DATE parameter which passes the value
in MDYY format

I want to convert the value into I8MDYY format

I have tried this but its not giving proper values

DEFINE TABLE SALES
RSDATE/I8MDYY=DTMDY(&RS_DATE, RSDATE);
REDATE/I8MDYY=DTMDY(&RE_DATE, RSDATE);
END

Thanks in Advance
We_Focus
 
Report This Post
Silver Member
posted Hide Post
Have you used DATECVT command? i guess it works.

RSDATE/I8MDYY = DATECVT(RS_DATE, 'MDYY', 'I8MDYY');
 
Posts: 41 | Location: Boston | Registered: August 17, 2005Report This Post
<We_Focus>
posted
Hi Dharma

The RS_DATE is a parameter not a field and i tried that it did not worked

RSDATE/I8MDYY = DATECVT(&RS_DATE, 'MDYY', 'I8MDYY');


If my Parameter value is 09/09/2005 then it returns 12/31/1900


thanks for Reply
We_Focus
 
Report This Post
Platinum Member
posted Hide Post
DM variables (&RS_DATE) can either be alpha or numeric. They can not be smart dates. That is why the DTMDY function isn't working. The function expects the first value to be smart date and it isn't. If the value of &RS_DATE is 09092005 (without slashes) you can define it right to I8MDYY. If it does have slashes, you can do it in 2 steps:

-SET &RS_DATE1=0902005;
-SET &RS_DATE2='09/09/2005';
-*
DEFINE FILE SALES
RSDATE1/I8MDYY = &RS_DATE1;
TEMP1/MDYY = '&RS_DATE2';
RSDATE2/I8MDYY = TEMP1;
END
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Guru
posted Hide Post
Here is some code that I have used to convert mm/dd/yyyy format dates to standard dates:

   
-SET &DATE01 = '09/05/2005';
-SET &DTLEN = &DATE01.LENGTH;
-SET &YY01 = GETTOK(&DATE01,&DTLEN,-,'/',4,'A4');
-SET &MM01 = GETTOK(&DATE01,&DTLEN,-,'/',2,'A2');
-* strip out /
-SET &MM02 = &MM01 + 100;
-SET &MM01 = EDIT(&MM02,'$99');
-SET &DD01 = GETTOK(&DATE01,&DTLEN,-,'/',2,'A2');
-SET &DD02 = &DD01 + 100;
-SET &DD01 = EDIT(&DD02,'$99');
-* make sure that months < Oct have a leading zero
-SET &DATE02 = &YY01 | &MM01 | &DD01;
-* above is integer
-SET &DATE03 = DATECVT(&DATE02,'I8YYMD','YYMD');
-* DATE03 is standard format date
HTH

This message has been edited. Last edited by: <Maryellen>,


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Platinum Member
posted Hide Post
Had a quick thought. This should work too:

-SET &RS_DATE2='09/09/2005';
DEFINE FILE SALES
RS_DATE2/I8MDYY = EDIT(EDIT('&RS_DATE2','99$99$9999'));
END
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders