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     REVERSE function blues :( [SOLVED]

Read-Only Read-Only Topic
Go
Search
Notify
Tools
REVERSE function blues :( [SOLVED]
 Login/Join
 
Master
posted
I have been using the REVERSE function to try to
reverse an &date string from YYMD to MDYY, and I am getting the error below:

-SET &BEG1 = '20090101';
-SET &END1 = '20090114';
-*
-TYPE &BEG1 = 20090101
&BEG1 = 20090101

-SET &BLEN = 08;
-*SET &YBEG = REVERSE(&BLEN,&BEG1,&YBEG);
-*TYPE &|YBEG = &YBEG
-*
-SET &ZBEG = REVERSE(08,20090101,'I8');

(FOC36355) INVALID TYPE OF ARGUMENT #3 FOR USER FUNCTION REVERSE

What am I doing wrong?
Frowner

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


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Virtuoso
posted Hide Post
Tom

REVERSE is not the best way to do this....

If it should work your result would be 10109002, but I wonder if that is the proper result....

Buy that book about dates....




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Virtuoso
posted Hide Post
quote:
-SET &ZBEG = REVERSE(08,20090101,'I8');

(FOC36355) INVALID TYPE OF ARGUMENT #3 FOR USER FUNCTION REVERSE


The complaint is that the 3rd arg (for the value returned by REVERSE) should be alpha.

In any event, reverse transforms
'abcdefgh' ('20081231') to
'hgfedcba' ('13218002');
you need to permute it to
'efghabcd' ('12312008').

Easy in APL, tedious in Focus.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Master
posted Hide Post
I'm gonna try to resolve this in three ways:

Method #1.
-SET &BDY = EDIT(&BEG1,'$$$$$$99');
-SET &BMN = EDIT(&BEG1,'$$$$99$$');
-SET &BYY = EDIT(&BEG1,'9999$$$$');
-SET &DATE1 = &BMN | &BDY | &BYY;


Method #2.
I am gonna purchase the Aviter book.

Method #3.
I am gonna do some more research.

Meanwhile, Method #1 will solve the problem
in the short term.

Thanks everyone! Music


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Virtuoso
posted Hide Post
If you take a look at the CHGDAT function, I think you can get what you want in one step.

This message has been edited. Last edited by: Darin Lee,


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Master
posted Hide Post
Thanks Darin! Good One

-SET &BEGDATE = '20090101';
-TYPE &BEGDATE
-*
-SET &NEW_DATE = CHGDAT('YYMD','MDYY',&BEGDATE,'A8');
-*
-TYPE &NEW_DATE
-EXIT


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Guru
posted Hide Post
Tom i don't have time to check but remember having problem returning a value back to a variable in function- you need to return it to an alpha format instead

so this (in psuedocode)

  &variable = Function(ARG1, ARG2, 'A10');


instead of

&variable = Function(ARG1, ARG2,&variable);  


where ARG3 is the argument that specifies the return field/format.


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Report This Post
Virtuoso
posted Hide Post
Nubi - that's what he has. The 'A8' which is the last argument in his function is used to specify the returned format when used with Dialogue Manager -SET.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Guru
posted Hide Post
quote:
  -*SET &YBEG = REVERSE(&BLEN,&BEG1,&YBEG);
-*TYPE &|YBEG = &YBEG
-*
-SET &ZBEG = REVERSE(08,20090101,'I8');


Sorry Darin, i didn't see that in his code in his first post... i only saw a return to the variable (will not work) or the return to an I8 (won't work either as its not an alpha)

whatever, as long as it works... Big Grin


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Report This Post
Guru
posted Hide Post
quote:
Originally posted by Darin Lee:
Nubi - that's what he has. The 'A8' which is the last argument in his function is used to specify the returned format when used with Dialogue Manager -SET.


ah i see what you mean, when he started using the CNBGDAT suggestion- my suggestion should work for his original REVERSE attempt but with A8 instead of I8...

personally i would have used CHGDAT in the first place Big Grin


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Report 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     REVERSE function blues :( [SOLVED]

Copyright © 1996-2020 Information Builders