Focal Point
STRIP function

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3481095842

September 25, 2007, 01:49 PM
Brenda
STRIP function
I am getting an error when trying to use this function. The error is:
(FOC36355) INVALID TYPE OF ARGUMENT #2 FOR USER FUNCTION STRIP - here is the function as I have it:

COMPUTE Aptdate/A8 = STRIP(10, APPT_DATE, '/', 'A8');

I am using Report Painter and am brand new to this product so any help would be much appreciated.


Brenda
WebFocus/Report Painter 7.6.4
Linux/MVS DB2
September 25, 2007, 01:53 PM
Prarie
Welcome
Please update your Signature on the Profile page as to what version of WebFocus you are using.

What is the Format of APPT_DATE?


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Try it on DEFINE.

This might help you
https://forums.informationbuilders.com/eve/forums/a/tpc/...1057331/m/2911016742


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
Brenda, it is possible that APPT_DATE is not an alpha field but a date field and so cannot be used in the STRIP function. depending on the format of APPT_DATE, you probably don't need to use the STRIP function to remove the slashes.

If APPT_DATE has format YYMD, do the following:

DATE2/A8YYMD = APPT_DATE;
Aptdate/A8 = DATE2;



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
COMPUTE APPT_DATE1/A8DMYY = APPT_DATE; NOPRINT
COMPUTE Aptdate/A8 = STRIP(10, APPT_DATE1, '/', 'A8');

Should do the job



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
John, no stripping necessary when going from A8YYMD to A8.

Cheers.


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
As you say you are new to Report Painter, why do you need to remove the '/'. As all have said if it is a smart date, the '/' are how it displays, you have to convert to an alpha field to get no '/' to display.


Leah
Brenda

It depends on why you want to remove the '/'.
If you want to do some calculations, use only the year or month part, change the format from YYMD to DMY or whatever, there are 1001 (or more) ways to do it.
For a starter sometimes a bit confusing.

We can help if we know a bit more, so please update your signature.




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

Thanks for all of your replies. I did not realize that you couldn't do the Strip function on a date field. I used a compute with the format YY|M|D to eliminate the '/' and that seems to have taken care of the problem. I had to remove the slashes in order to compare this date to another and didn't realize that there were so many date 'functions' available. Like I said, I'm brand new to this so just getting my feet wet. Thanks again to all! I'm moving on to a really complicated issue next and I may have to come back for some real help... Smiler


Brenda
WebFocus/Report Painter 7.6.4
Linux/MVS DB2
Good point Francis.

Brenda we can help you better if you show your webfocus release as part of your signature.



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo