12. Report-Writer Statements : Column and Block Statements : .Block/.Endblock Statements—Enable/Disable Block Mode : Examples
 
Share this page                  
Examples
1. Assume the following sequence of Report-Writer statements:
.block
      .print 'Line 1' .newline
      .print 'Line 2' .newline
      .top
      .tab 10 .pr 'more line 1' .newline
.endblock
You would get the following output:
Line 1 more line 1
Line 2
2. Assume the following sequence of Report-Writer statements:
.sort region, state
.header region
      .need 4
      .block
          .print 'Region: ', region .nl
.detail
      .tab 5
      .print state(c15)
      .tab 30
      .print tot_18to65('n,nnn,nnn')
      .newline
.footer region
      .top
      .lineend
      .tab + 5
      .print 'Count of states: '
      .println count(state) (f3)
.end block
You would get the following output:
Region: East South Central  Count of states:  4
Alabama                     2,528,938
Kentucky                    2,971,232
Mississippi                 1,393,283
Tennessee                   3,283,432
Region: Mountain            Count of states:  8
Arizona                     1,604,948 
Colorado                    2,112,352 
Idaho                       0,698,802 
Montana                     0,663,043 
Nevada                      0,448,177 
New Mexico                  0,915,815 
Utah                        1,031,926 
Wyoming                     0,323,024