Skip to content

Appendices

Presidents.dat, Presidents2.dat

The file presidents.dat, used in many examples in this document, is a fixed-length sequential file with a record length of 85 bytes. As a fixed-length sequential file, it can be described as either as sequential file (org sq) or a relative file (org rl). The data in presidents.dat is below.

       01     George Washington         178904301797030408   Independent            John Adams 
       02     John Adams                179703041801030404   Federalist             Thomas Jefferson 
       03     Thomas Jefferson          180103041809030408   Democratic-Republican  Aaron Burr 
       04     James Madison             180903041817030408   Democratic-Republican  George Clinton 
       05     James Monroe              181703041825030408   Democratic-Republican  Daniel D. Tompkins 
       06     John Quincy Adams         182503041829030404   Democratic-Republican  John C. Calhoun 
       07     Andrew Jackson            182903041837030408   Democratic             John C. Calhoun 
       08     Martin Van Buren          183703041841030404   Democratic             Richard Mentor Johnson
       09     William Henry Harrison    184103041841040400   Whig                   John Tyler 
       10     John Tyler                184104041845030404   Whig                   Vacant 
       11     James K. Polk             184503041849030404   Democratic             George M. Dallas 
       12     Zachary Taylor            184903041850070901   Whig                   Millard Fillmore 
       13     Millard Fillmore          185007091853030403   Whig                   Vacant 
       14     Franklin Pierce           185303041857030404   Democratic             William R. King 
       15     James Buchanan            185703041861030404   Democratic             John C. Breckinridge 
       16     Abraham Lincoln           186103041865041504   Republican             Andrew Johnson 
       17     Andrew Johnson            186504151869030404   Democratic             Vacant 
       18     Ulysses S. Grant          186903041877030408   Republican             Schuyler Colfax 
       19     Rutherford B. Hayes       187703041881030404   Republican             William A. Wheeler 
       20     James A. Garfield         188103041881091900   Republican             Chester A. Arthur 
       21     Chester A. Arthur         188109191885030404   Republican             Vacant 
       22     Grover Cleveland          188503041889030404   Democratic             Thomas A. Hendricks 
       23     Benjamin Harrison         188903041893030404   Republican             Levi P. Morton 
       24     Grover Cleveland          189303041897030404   Democratic             Adlai E. Stevenson 
       25     William McKinley          189703041901091404   Republican             Theodore Roosevelt 
       26     Theodore Roosevelt        190109141909030408   Republican             Vacant 
       27     William Howard Taft       190903041913030404   Republican             James S. Sherman 
       28     Woodrow Wilson            191303041921030408   Democratic             Thomas R. Marshall 
       29     Warren G. Harding         192103041923080202   Republican             Calvin Coolidge 
       30     Calvin Coolidge           192308021929030407   Republican             Charles G. Dawes 
       31     Herbert Hoover            192903041933030404   Republican             Charles Curtis 
       32     Franklin D. Roosevelt     193303041945041212   Democratic             Harry S. Truman 
       33     Harry S Truman            194504121953012008   Democratic             Alben W. Barkley 
       34     Dwight D. Eisenhower      195301201961012008   Republican             Richard Nixon 
       35     John F. Kennedy           196101201963112202   Democratic             Lyndon B. Johnson 
       36     Lyndon B. Johnson         196311221969012006   Democratic             Hubert Humphrey 
       37     Richard Nixon             196901201974080905   Republican             Gerald Ford 
       38     Gerald Ford               197408091977012003   Republican             Nelson Rockefeller 
       39     Jimmy Carter              197701201981012004   Democratic             Walter Mondale 
       40     Ronald Reagan             198101201989012008   Republican             George H. W. Bush 
       41     George H. W. Bush         198901201993012004   Republican             Dan Quayle 
       42     Bill Clinton              199301202001012008   Democratic             Al Gore 
       43     George W. Bush            200101202009012008   Republican             Dick Cheney 
       44     Barack Obama              200901202013012004   Democratic             Joe Biden

The file presidents2.txt is a variable-length line sequential file with a minimum record length of 12 bytes and a maximum record length of 24 bytes. The data in presidents2.txt is below:

       44     Barack Obama
       43     George W. Bush
       42     Bill Clinton
       41     George H. W. Bush
       40     Ronald Reagan
       39     Jimmy Carter
       38     Gerald Ford
       37     Richard Nixon
       36     Lyndon B. Johnson
       35     John F. Kennedy
       34     Dwight D. Eisenhower
       33     Harry S Truman
       33     Warren G. Harding
       32     Franklin D. Roosevelt
       31     Herbert Hoover
       30     Calvin Coolidge
       28     Woodrow Wilson
       27     William Howard Taft
       26     Theodore Roosevelt
       25     William McKinley
       24     Grover Cleveland
       23     Benjamin Harrison
       22     Grover Cleveland
       21     Chester A. Arthur
       20     James A. Garfield
       19     Rutherford B. Hayes
       18     Ulysses S. Grant
       17     Andrew Johnson
       16     Abraham Lincoln
       15     James Buchanan
       14     Franklin Pierce
       13     Millard Fillmore
       12     Zachary Taylor
       11     James K. Polk
       10     John Tyler
       09     William Henry Harrison
       08     Martin Van Buren
       07     Andrew Jackson
       06     John Quincy Adams
       05     James Monroe
       04     James Madison
       03     Thomas Jefferson
       02     John Adams
       01     George Washington
Back to top