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
February 06, 2007, 02:10 AM
jimster06
You could concatenate the fields using strong concatenation to essentially sqeeze out trailing blanks:
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.
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! -dThis 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
February 06, 2007, 03:30 AM
FrankDutch
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
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.
February 06, 2007, 06:47 AM
FrankDutch
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
February 06, 2007, 09:57 AM
Leah
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 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
February 06, 2007, 10:15 AM
susannah
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
February 06, 2007, 10:39 AM
ira
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
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).