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     Remove trailling spaces from a local variable in focus 7.2.2

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Remove trailling spaces from a local variable in focus 7.2.2
 Login/Join
 
Member
posted
Hi,

I'm new here so please be gentle with me.

I'm not really a dedicated focus programmer but am responsible for new reports for my department. We use Focus 7.2.2 on MVS so quite old fashioned programming.

I've been tasked with using some crtforms to ask for a few variables which then help to dynamically create some mainframe datasets.

One of the variables will appear in the middle of a dataset but potentially the variable could have trailling spaces.

Can anyone tell me if there is an easy way to lose the trailling spaces in the variable as it will go from a length of 8 characters when input into the crtform to a variable length when creating the dataset name?

Thanks,

Brian


Focus 7.2.2
 
Posts: 3 | Registered: June 16, 2008Report This Post
Virtuoso
posted Hide Post
Brian,
When you create your dataset, I assume that you will first create the complete &-variable that will contain the complete filename.
In that assigment you can use strong concatenation, ie the double pipe symbol (||) which will remove any trailing blanks from the first variable.
Example:
-SET &VAR1 = 'NAME    ';
-SET &VAR2 = '.EXT';
-SET &FILENAME = &VAR1 || &VAR2;
-TYPE &FILENAME

Of course, this example deals with PC-style filenames, but the principle of using the || stays the same.
Give it a try and let us know if this answers your problem.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Guru
posted Hide Post
A character function also comes to mind: TRIM. This might also be useful.


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Expert
posted Hide Post
All functions in Dialogue Manager require the output length of the string, so you have to determine the ARGLEN and use that as the output length, as in this example using SUBSTR (substring):

-SET &ECHO=ALL;

-SET &VAR1 = 'TEST             ';

-TYPE VAR1 LENGTH: &VAR1.LENGTH

-SET &VAR1L= ARGLEN(&VAR1.LENGTH, &VAR1, 'I3');

-* SUBSTR(INLENGTH, PARENT, START, END, SUBLENGTH, OUTFIELD)

-SET &VAR1A =
-  SUBSTR(&VAR1.LENGTH, &VAR1, 1, &VAR1L, &VAR1L, 'A&VAR1L.EVAL');

-TYPE VAR1A LENGTH: &VAR1A.LENGTH


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
Virtuoso
posted Hide Post
Brian,

There another way, maybe a bit "expensive", which is writing the variable to a file and then reading it back (I assume that a file called SAVE is allocated):
  
-SET &A='BRIAN        ';
-WRITE SAVE &A
-RUN
-READ SAVE,&B
-TYPE &A.LENGTH &B.LENGTH


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
Brian,
are you taking this variable new from a crtform or does it exist in a database already?
I'm not understanding
'will appear in the middle of a dataset '
I ask because there's a difference between working on an &variable (taken from a CRTFORM)
and editing an existing field with a DEFINE, when taken from a database.
Clarify, would you?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
It sounds to me like Brian is trying to construct an MVS dataset name and is trying to use the variable as one of the middle nodes. I think that the earlier post showing strong concatenation should do what he wants.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
If the variable is a Dialog Manager variable (&), use TRUNCATE.

&TRUNCVAR = TRUNCATE(&VAR) ;


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
Virtuoso
posted Hide Post
Waz,

Nice. And this function is NOT documented in the FUNCTIONS pdf!!!


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Member
posted Hide Post
Blimey so many responses and so many ways of doing it.

I tried the simplest method first which was the strong concatenation which was unsuccesful but the truncate function worked perfectly so went with that.

Thanks everyone for you suggestions and now that I've found this excellent forum no doubt I'll be writing on here often. Smiler


Focus 7.2.2
 
Posts: 3 | Registered: June 16, 2008Report This Post
Expert
posted Hide Post
see this doc




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
Thanks Susannah that explains perfectly when I can and can't use it.


Focus 7.2.2
 
Posts: 3 | Registered: June 16, 2008Report This Post
Master
posted Hide Post
BRIAN,

Be sure to read the posts daily, I've been doing FOCUS/WebFocus for 18 years and I learn enough from the Forum to make it worth my time to check them every day.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
Pat your on the money, I've been doing FOCUS/WebFOCUS for 24 Years and am still learning, found many interesting things in the forum too.


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
Master
posted Hide Post
I'm with Waz and PB. I've been coding FOCUS and WebFOCUS since PC FOCUS 1.5, about 24 years and I have this site email me all the updated posts every day and I review them every day. Those that have something I need or think I may need get saved in my IE Favorites under a group name WebFOCUS Solutions. The list is quite large and someday I'm going to have to figure out a way to create categories under WebFOCUS Solutions.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Master
posted Hide Post
Not only do I learn something new everyday, I enjoy being able to help others learn and even when I have nothing to add I feel like I've been chatting with friends.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 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     Remove trailling spaces from a local variable in focus 7.2.2

Copyright © 1996-2020 Information Builders