12. Report-Writer Statements : Column and Block Statements : .Width Statement--Set Output Width of a Column : Example
 
Share this page                  
Example
To print the following columns of salaries, set up desired position, formats and widths:
 New Salary    Old Salary
 | $50,000.00 | $45,000.00 |
 | $32,000.00 | $28,800.00 |
 | $35,000.00 | $31,500.00 |
 |    $100.00 |     $90.00 |
 | $35,000.00 | $31,500.00 |
 | $25,000.00 | $22,500.00 |
 |  $5,000.00 |  $4,500.00 |

.declare salary_fmt = c14 with value '''$$$,$$$.nn''' 
.declare salary_wid = integer with value '12'
.header report
    .position sal1(0), sal2(13)
    .format   sal1, sal2  ($salary_fmt)
    .width   sal1, sal2  ($salary_wid),
    .underline
    .center   sal1  .print  'New Salary'
    .center   sal2  .print  'Old Salary'
    .newline
    .nounderline
.detail
    .left   sal1  .print  '|'
    .right   sal1  .print  sal1
    .print ' |'
    .right   sal2  .print  sal2
    .print ' |'
    .newline