Save 
Join IIUG
 for   
 

Informix News
13 Jan 12 - MC Press online - Informix Dynamic Server Entices New Users with Free Production Edition ... Read
11 Jan 12 - Computerworld - Ecologic Analytics and Landis+Gyr -- Suitors Decide to Tie the Knot... Read
9 Jan 12 - planetIDS.com - DNS impact on Informix / Impacto do DNS no Informix... Read
8 Sep 11 - TMCnet.com - IBM Offers Database Solution to Enable Smart Meter Data Capture... Read
1 Aug 11 - IBM Data Management Magazine - IIUG user view: Happy 10th anniversary to IBM and Informix... Read
8 Jul 11 - Database Trends and Applications - Managing Time Series Data with Informix... Read
31 May 11 - Smart Grid - The meter data management pitfall utilities are overlooking... Read
27 May 11 - IBM Data Management Magazine - IIUG user view: Big data, big time ( Series data, warehouse acceleration, and 4GLs )... Read
16 May 11 - Business Wire - HiT Software Announces DBMoto for Enterprise Integration, Adds Informix. Log-based Change Data Capture... Read
21 Mar 11 - Yahoo! Finance - IBM and Cable&Wireless Worldwide Announce UK Smart Energy Cloud... Read
14 Mar 11 - MarketWatch - Fuzzy Logix and IBM Unveil In-Database Analytics for IBM Informix... Read
11 Mar 11 - InvestorPlace - It's Time to Give IBM Props: How many tech stocks are up 53% since the dot-com boom?... Read
9 Mar 11 - DBTA - Database Administration and the Goal of Diminishing Downtime... Read
2 Feb 11 - DBTAs - Informix 11.7 Flexible Grid Provides a Different Way of Looking at Database Servers... Read
27 Jan 11 - exactsolutions - Exact to Add Informix Support to Database Replay, SQL Monitoring Solutions... Read
25 Jan 11 - PR Newswire - Bank of China in the UK Works With IBM to Become a Smarter, Greener Bank... Read
12 Oct 10 - Database Trends and Applications - Informix 11.7: The Beginning of the Next Decade of IBM Informix... Read
20 Sep 10 - planetIDS.com - ITG analyst paper: Cost/Benefit case for IBM Informix as compared to Microsoft SQL Server... Read
20 Jul 10 - IBM Announcements - IBM Informix Choice Edition V11.50 helps deploy low-cost scalable and reliable solutions for Apple Macintosh and Microsoft Windows... Read
20 Jul 10 - IBM Announcements - Software withdrawal: Elite Support for Informix Ultimate-C Edition... Read
24 May 10 - eWeek Europe - IBM Supplies Database Tech For EU Smart Grid... Read
23 May 10 - SiliconIndia - IBM's smart metering system allows wise use of energy... Read
21 May 10 - CNET - IBM to help people monitor energy use... Read
20 May 10 - ebiz - IBM Teams With Hildebrand To Bring Smart Metering To Homes Across Britain... Read
19 May 10 - The New Blog Times - Misurare il consumo energetico: DEHEMS è pronto... Read
19 May 10 - ZDNet - IBM software in your home? Pact enables five-city smart meter pilot in Europe... Read
17 March 10 - ZDNet (blog) David Morgenstern - TCO: New research finds Macs in the enterprise easier, cheaper to manage than... Read
17 March 2010 - Virtualization Review - ...key components of Big Blue's platform to the commercial cloud such as its WebSphere suite of application ser vers and its DB2 and Informix databases... Read
10 February 2010 - The Wall Street Journal - International Business Machines is expanding an initiative to win over students and professors on its products. How do they lure the college crowd?... Read


End of Support Dates

IIUG on Facebook IIUG on Twitter


[ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Classics Forum

RE: Multiple columns of output on ACE

Posted By:
Date:

I did not realize that attachments do not post. Here is a slightly more
elegant solution that uses arrays (actually subscripts).

And yes, you must have a last row to flush out the last records.

Regards,
Rich

email: rghiz@attbi.com


{==========================================================================}
{ }
{ File: labels.ace - Mailing Label Specification }

{ }
{==========================================================================}
{ Author: R. Ghiz }
{ Date: 01/21/93 }
{ This report prints 1-2 mailing labels across a page. It stores the }

{ labels in character strings (array1 thru array7) as it reads each row, }
{ and prints the labels when it has read the proper number of rows. }
{ At run time, user specifies the date to be used as selection }

{ criteria. }
{ Notes: }
{ Designed to print on 1-1/3" x 4.0" label stock }
{ Modifications: }

DATABASE minx100 END

DEFINE
VARIABLE cst char(43) {holds city, state, zip}
VARIABLE country CHAR(15) {variable for country}
VARIABLE array1 char(84) {Array for Rep., Cust ID}
VARIABLE array2 char(84) {Array for contact}
VARIABLE array3 char(84) {Array for company}
VARIABLE array4 char(84) {Array for address line 1}
VARIABLE array5 char(84) {Array for address line 2}
VARIABLE array6 char(84) {Array for city, state, zip}
VARIABLE array7 char(84) {Array for country}
VARIABLE start smallint {start of current label in
array}
VARIABLE finish smallint {end of current label in array}
VARIABLE l_size smallint {label width}
VARIABLE white smallint {spaces between each label}
VARIABLE count1 smallint {number of labels across page}
VARIABLE i smallint {label counter}
VARIABLE pg_count smallint {page counter}
VARIABLE bg_date DATE {date criteria}
END

INPUT
PROMPT FOR bg_date USING
"Enter Customer Review Date for search (mm/dd/yyyy)?"
END

OUTPUT
TOP MARGIN 2
BOTTOM MARGIN 0
LEFT MARGIN 0
PAGE LENGTH 60
REPORT TO "/var/tmp/labels.out"
END

SELECT
cust, {customer ID 10A}
arname, {customer name 30A}
aradr1, {address line 1 30A}
aradr2, {address line 2}
arcity, {city 20A}
arstat, {state 10A}
arzip, {zip code 10A}
arctry, {country 15A}
arcont, {customer contact 15A}
arcat, {customer category, to be used for BG code}
arsale, {sales rep. ID 10A}
arnoten, {note code used for source}
arcdat {credit review date, to be used for BG date}
FROM
arcust
WHERE arcdat = $bg_date AND
arcat = "bg"
ORDER BY arzip
END

FORMAT
FIRST PAGE HEADER

{ Nothing is displayed in this control block. It just initializes
variables that are used in the ON EVERY ROW control block }

LET count1 = 2 {# of labels across page, 2 up}
{count1=3 for 3 up}
LET i = 1 {Initialize label counter.}
LET l_size = 80/count1 {Determine label width (allow
five spaces total between labels) }
LET white = 5/count1 {Divide the five spaces between
the number of labels across the
page.}
LET pg_count = 1 {Init. no of labels on page}

ON EVERY ROW
IF arctry = "U.S.A." OR arctry = "USA" THEN
BEGIN
LET country = " "
LET cst = arcity CLIPPED, ", ", arstat CLIPPED, " ",
arzip CLIPPED
END
ELSE
BEGIN
LET country = arctry
LET cst = arcity CLIPPED, " ", arstat CLIPPED, " ",
arzip CLIPPED
END

LET finish = i * (l_size + white)
IF i = 1 THEN {force start for each label}
LET start = 2
ELSE
LET start = 44


{ This section assigns names, companies, addresses and zip codes
to arrays 1 thru 7 until i = the number of labels across a page }

LET array1[start, finish] = arnoten, "*", arsale
LET array1[finish - 15, finish] = cust
LET array2[start, finish] = arcont {contact}
LET array3[start, finish] = arname {company}

IF aradr1 = " " THEN {move lines up one if
1st}
BEGIN {address line is blank}
LET array4[start, finish] = aradr2
LET array5[start, finish] = cst
LET array6[start, finish] = country
LET array7[start, finish] = " "
END
ELSE
IF aradr2 = " " THEN {move lines up one if
2nd}
BEGIN {address line is blank}
LET array4[start, finish] = aradr1
LET array5[start, finish] = cst
LET array6[start, finish] = country
LET array7[start, finish] = " "
END
ELSE
BEGIN {print all address lines}
LET array4[start, finish] = aradr1
LET array5[start, finish] = aradr2
LET array6[start, finish] = cst
LET array7[start, finish] = country
END

IF i = count1 THEN
BEGIN
PRINT array1 CLIPPED {Print Rep. and Cust ID}
PRINT array2 CLIPPED {Print contact}
PRINT array3 CLIPPED {Print company}
PRINT array4 CLIPPED {Use clipped to remove trailing}
PRINT array5 CLIPPED {spaces for quicker printing.}
PRINT array6 CLIPPED
PRINT array7 CLIPPED
SKIP 1 LINE
LET array1 = " " {Reset the arrays to spaces.}
LET array2 = " "
LET array3 = " "
LET array4 = " "
LET array5 = " "
LET array6 = " "
LET array7 = " "
LET i = 1
LET pg_count = pg_count + 1 {increment # of lables}

IF pg_count > 7 THEN
BEGIN
SKIP TO TOP OF PAGE
LET pg_count = 1
END

END
ELSE
LET i = i + 1

ON LAST ROW
IF i > 1 {Print the last set of addresses}
THEN
BEGIN {if there were any left.}
PRINT array1 CLIPPED
PRINT array2 CLIPPED
PRINT array3 CLIPPED
PRINT array4 CLIPPED
PRINT array5 CLIPPED
PRINT array6 CLIPPED
PRINT array7 CLIPPED

LET pg_count = pg_count + 1
IF pg_count > 7 THEN
BEGIN
SKIP TO TOP OF PAGE
LET pg_count = 1
END

END
END

Messages In This Thread

[ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Classics Forum is maintained by Administrator with WebBBS 5.12.