Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cramming different items in one column

Status
Not open for further replies.

pvuppa1

Programmer
Nov 14, 2003
61
US
Can anyone tell me how to concatenate more than 1 field and displaying it as a single field, in other words cramming or sqeezing data into one field.
I have fields called LASTNAME, FIRSTNAME ,STREET, CITY, STATE, ZIP and some company info in my master file. I want to create a report like

Customer Profession

mikeanderon Programmer
3323 Lovedale Blvd Some Company
Dallas Comp Info
TX 88888. Company Address


.....Is there any other than using OVER since I have some more details to show just like customer details.
Please help
-P
 
You can define a new variable and use the concatenation operator like:

wholename/A??=firstname | lastname;

or if you want strip trailing blanks:

wholename/A??=firstname || lastname;

Is that what you mean?
 
can i use a new line while concatenation? like
DEFINE FILE myfile
details/A250=LASTNAME|FIRSTNAME|'newline??'|STREET|CITY;
END
 
I need a new line character while concatenating, since I have so many fields to group together and display it on the report. Like customer Info and Company Info, all of these fields are coming from same MASter file. so please help me.
I needed somethin like this
All the fields below are associated to one single table in Master file. Im just trying to display all the fields by grouping them in a single field (like CustomerInfo, CompanyInfo)

CustomerInfo CompanyInfo

LastName, Firstname Name of company
Street, Address
City StartDate
State SomeOtherDate
Zip
 
Thinks like a new line character are dependent on both the hardware and the OS. Windows, for example, doesn't let you get at the hardware level. Focus, is, of course, also not designed to do this.

Why don't you use OVER to break the line? That's what it's for. Also, you MAY be able to use BYPANEL which will repeat the BY fields as you move through the screens of a wide output. BYPANEL is a may because it may not be supported for your product.
 
Hi,
OVER statement works for one set of column but not for the other, I can use OVER for all the customer related fields but I have to also show compinfo on another column check this
TABLE FILE MYFILE
PRINT
lname OVER
fname OVER
street OVER
city OVER
state
compname OVER
compaddress OVER
compphone OVER
compfax over
.......
.....

END
This is not working gave me an eror, after grouping custinfo i have to do the same for the compinfo and so on and so forth. there's whole bunch of fields i need to display in one single screen.
let me know
 
Well, you know you can concatenate at this point. The only issue is breaking the line with an OVER. So, concatenate everything you need on a line, and then do the OVER.

The other thing you can do is subheads or subfoots. With these, all of your verb objects get a NOPRINT. You then display them as desired. For example,

ON yourfield SUBFOOT
&quot;<LNAME><40><COMPNAME>&quot;
&quot;<FNAME><40><COMPADDRESS>&quot;
&quot;<STREET><40><COMPPHONE>&quot;
etc.
 
I use kiddpete's method all of the time for doing things like this. Using over tends to become a problem when the report needs other fields added causing you to have to rearrage the over statement usually. If you are only showing one individuals information on a page, you can also use what is called free-form reporting, which is basically putting all of your fields where you want them into the heading. Then you just set a page-break on your BY fields with a NOPRINT.
 
Im getting an error called (FOC687) TEXT FIELDS CANNOT BE PRINTED WITH OVER.
i thought I can use OVER for grouping my fields together. Please tell me more about free-form reporting
 
Do you really need &quot;TEXT&quot; fields? In many cases, when the master is created from a relational database, the database use a varchar(20) field. Focus will make a usage of TX50 in a case like this, but it would be perfectly fine to replace the usage to A20 for this example. This would take care of the focus error that you indicated above. SUBHEAD, SUBFOOT, and the HEADING should all be able to handle the text fields (at least in 5.2.x, not sure about 4.x.x).

Free-form reporting is simply creating a report without a report body by using only the heading, subhead, subfoot, and footing.

for example
TABLE FILE CUSTOMERS
HEADING
&quot;<50> My Customer List By Region&quot;
&quot;Region: <REGION_CD&quot;
&quot; &quot;
-* since there is no body to the report NOPRINT is used.
-* since I am using a field in the heading, I page-break on the field so that heading will change each time the field changes.
BY REGION_CD NOPRINT PAGE-BREAK
BY CUSTOMER_NUMBER NOPRINT
ON CUSTOMER_NUMBER SUBHEAD
&quot;<LASTNAME<FIRSTNAME <10 <CUSTOMER_NUMBER&quot;
&quot;<COMPANY&quot;
&quot;<ADDR1&quot;
&quot;<ADDR2&quot;
&quot;<CITY <STATE <ZIP&quot;
&quot;<PHONE_NUMBER&quot;
END

Notice there there is nothing to produce a body of a report. You could have a report body if you so choosed however.
 
How do i display a field with TX50 using OVER command?
 
The only way that I know of that you would be able show it using OVER is by changeing the usage from TX50 to A50 or A255 - something like that.
 
still having problem with focus error. I tried
DEFINE FILE MYFILE
longfield/A20=field2
END
TABLE FILE MYFILE
PRINT
field1 over
longfield
END
..ended up having the same problem &quot;text fields cannot be printed with over&quot;, that is actually like a memo field with lot of text.
I tried using free-form report with subhead like you said but no luck :-(
im starting to hate wf
let me know
 
You can't change a TX field to an A?? field in a define. It must be done in the master file description.

Is this coming from a relational database? If so, what is the native format of the field?

If you are set on using OVER in the request and it is a relational database, you may be able to use the following below.

In the MFD, if your field is
FIELD=MY_TX_FLD, ALIAS=MY_TX_FLD, USAGE=TX50, ACTUAL=TX,$

add a line below this to say
FIELD=MY_ALPHA_FLD, ALIAS=MY_TX_FLD, USAGE=A20, ACTUAL=A20,$

you would then reference the field in your report as MY_ALPHA_FLD instead of MY_TX_FLD. (This will not work if it is a FOCUS file -- eg SUFFIX=FOC in the MFD)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top