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     FOCUS to count the length

Read-Only Read-Only Topic
Go
Search
Notify
Tools
FOCUS to count the length
 Login/Join
 
<Raghuraman>
posted
I am in fresher in FOCUS
I have 3 Field in in FOCUS file in
LASTNNAME,FIRSTNAME,INIT
Each size is 25,25,1
data like a
LASTNAME FIRSTNAME INIT
AAAA GGGGGG J
BB EEEE L
CCCCCC GGG O

I want display like

Fullname(40 chacter length)
---------
AAAA, GGGGGG J
BB, EEEE L
CCCCCC, GGG O


How can solve this problem Please give me a solution
 
Report This Post
Guru
posted Hide Post
You could concatenate the fields using strong concatenation to essentially sqeeze out trailing blanks:

fullname/a40=LASTNAME || ', ' | FIRSTNAME || ' ' | INITIAL;

The two || are strong concatenation and do the squeeze. The single | is a weak concatenation and just strings the two fields together. Note that I have added a comma following the last name and a space following the firstname.


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Member
posted Hide Post
Hey Raghuraman,

Try using something like this:

-SET &LASTNAME = 'AAAA';
-SET &FIRSTNAME = 'GGGGGG';
-SET &INITIAL= 'J';

-SET &FULLNAME = &LASTNAME||', '|&FIRSTNAME||' '|&INITIAL;
-TYPE &FULLNAME

Use a double-pipe to concatenate fields (or variables) and a single pipe to enfoce soft concatenation (i.e. to retain the spaces inbetween the elements)

Hope this helps!
-d

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


Prod: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Test: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Local: DevStudio 5.5.3 - Management Console
- Windows XP SP2
 
Posts: 21 | Location: Cape Town, South Africa | Registered: January 15, 2007Report This Post
Virtuoso
posted Hide Post
besides the already mentioned solutions you might consider the fact that 25+25+1 is more than the desired 40 length, so you must add
SHORTFIRTS/A20=EDIT(FIRSTNAME,'99999999999999999999');
and something similar to the other fields.

Frank




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
Member
posted Hide Post
Try this,

TABLE FILE myfile
PRINT
COMPUTE CONCAT /A54 = LASTNAME || ',' || (' ' | FIRSTNAME) || (' ' | INITIAL); NOPRINT
COMPUTE FULLNAME/A40 = SUBSTR (54, CONCAT, 1, 40 , 40, 'A40');
END

Michel


WF 8.1.05M/8.2.06,CentOs,Windows,Oracle ,Postgress
 
Posts: 14 | Location: Canada, U.S.A., Ivory Coast | Registered: February 02, 2007Report This Post
<Raghuraman>
posted
hi all
It not working correctly It display the data with spaces after print the comma(,).
I no need like this one
See
LNAME field length is 25. but the varibale contains only less then or equal 25.
What i want i need to eliminate the space

for example
temp=substr(25,LNAME,1,LENGTH(LNAME),LENGTH(LNAME),TEMP);

LENGTH is not correct statement. Just i put u can easy to understand.
 
Report This Post
Virtuoso
posted Hide Post
maybe a manual will help and some basic courses?

look properly at the piping characters.
you can eliminate the spaces with that function
it works like "Trim" in excel.




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
Isn't it wonderful the ways you can solve a problem.

Here's a code snippit as to how we push names to gether

EXPNDNME/A72= FMN_NAME || ( ' ' | LST_NAME | ' ' ) || SFX_NAME || '*' ;
CMPRSNME/A32= GETTOK ( EXPNDNME , 66 , 1 , '*' , 32 , CMPRSNME );
FUL_NAME/A32= LJUST ( 32 , CMPRSNME , FUL_NAME );

EXPNDNME are all the fields conctenated with spacing plus an asterisk, then we use the GETTOK function then LJUST, the LJUST is just a safety measure in case one of the leading fields has blanks. This code has been around since before I came to work at UNO.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
If you want to use the SUBSTR function, try the ARGLEN function as well, it measures the exact length of a string.




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
Platinum Member
posted Hide Post
The easiest way to see this would be to set up a define as such:
FULLNAME/A40=LASTNAME||(' '|FIRSTNAME)||(' '|MIDDLEINIT);

THIS WILL INSERT BLANK SPACES BETWEEN THE LAST NAME AND FIRST NAME AND THE FIRST NAME AND THE MIDDLE INIT. jUTS REMEMBER TO SOUND SPACES TOWARD THE NUMBER SPECIFIED IN YOUR DEFINE AS WELL AS THE FIELD NAMES BEING USED. G'lUCK rAGU. iRA


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Report This Post
Expert
posted Hide Post
ira,

i THINK THAT YOUR cAPS lOCK KEY IS ON Big Grin

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
acknowledged. Sorry


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Report This Post
Platinum Member
posted Hide Post
quote:
The easiest way to see this would be to set up a define as such:
FULLNAME/A40=LASTNAME||(' '|FIRSTNAME)||(' '|MIDDLEINIT);

THIS WILL INSERT BLANK SPACES BETWEEN THE LAST NAME AND FIRST NAME AND THE FIRST NAME AND THE MIDDLE INIT. jUTS REMEMBER TO SOUND SPACES TOWARD THE NUMBER SPECIFIED IN YOUR DEFINE AS WELL AS THE FIELD NAMES BEING USED. G'lUCK rAGU. iRA

It was pointed out to me that my caps lock was on so let me repost correctly this time:

Place what you want inside a define or -SET. Syntax for the define is as follows:
FULLNAME/A42=LASTNAME||(' '|FIRSTNAME)||(' '|MIDDLEINIT);

This will insert blanks between each part of the fieldnames (if your requirements are commas, simply add them inthe define where needed.
Remember: to include the number of spaces and/or commas being used in your define format.
Ira.. (o and sorry re: the caps lock on b4).


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Report 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     FOCUS to count the length

Copyright © 1996-2020 Information Builders