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     Error in trim command, focus 7.3..3. Z/Vm

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Error in trim command, focus 7.3..3. Z/Vm
 Login/Join
 
Member
posted
I tried sending the a message with the subject "Remove leading and trailing spaces in a string". It was rejected so I am trying here. I need to remove leading and trailing blanks in a string. I wrote the following simple Maintain program.

MAINTAIN FILE PARKDATA
MODULE IMPORT (MNTUWS) ;

Compute
tbrownid/a9 ; -* brownid or plate (for non-permit violation or
-* a towed vechile
trimid/a9 ; -* brownid without leading and trailing blanks
lenid/i2 ; -* lenght of trimed brown id

compute tbrownid =3D ' 3 ' ;
lenid =3D LENGTH(tbrownid) ;
trimid =3D TRIM('B' , tbrownid , lenid , ' ' , 1 , 'A9' ) ;

type "id ..tbrownid lenght ..lenid trimed ..trimid "

END

(I used .. because other wise systems I am including am html tab)
If I run it I get the following error message

ERROR AT OR NEAR LINE 13 IN PROCEDURE YYY FOCEXEC *
(FOC03609) Wrong argument count in call to case TRIM. Got 5, expected
0.
id 3 lenght 9 trimed B

Why, line 13 is the line with the TRIM function giving an error message? It is right out of the manual. How do I fix it?
 
Posts: 11 | Registered: June 12, 2003Report This Post
Expert
posted Hide Post
Claude,

There are two functions called TRIM, one for WebFOCUS reporting and the other for Maintain.

As you are using Maintain in your example you should use the appropriate TRIM function which has the syntax - TRIM(string).

Your example shows the TRIM function for reporting.
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
on Z/VM I could not find TRIM(string) function.

I copied the TRIM(...) syntax right out of the onleine manual.

I tried it anyway and it did not give the correct result.
 
Posts: 11 | Registered: June 12, 2003Report This Post
Expert
posted Hide Post
Claude,

Unfortunately I don't have access to Z/VM and therefore can only relate what the difference is between the two TRIM functions.

Give your local IB support a call and get them to double check the syntax for you.
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Master
posted Hide Post
Claude
The TRIM function, when used in Maintain, removes trailing blanks. Here is an example:

MAINTAIN
COMPUTE NAME/A0 = 'MARK1 ';
COMPUTE X/I3 = LENGTH(NAME);
COMPUTE NAME = TRIM(NAME);
COMPUTE Y/I3 = LENGTH(NAME);
TYPE "X = <<X Y = <<Y"
END

yields
X = 15 Y = 5

Trim is useful if you are using CONTAINS and don't want any trailing blanks. If this doesn't solve the problem, please let us know what you are trying to do.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report 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     Error in trim command, focus 7.3..3. Z/Vm

Copyright © 1996-2020 Information Builders