* Reading character variables * Example 1 - Character variable enclosed by " ". sample 1 9 read province ur vr / charvars=1 "Newfoundland" 14.9 4.0 "Nova Scotia" 9.1 5.0 "New Brunswick" 12.2 7.0 "Quebec" 9.1 6.0 "Ontario" 7.1 5.0 "Manitoba" 6.7 8.0 "Saskatchewan" 4.8 8.0 "Alberta" 5.3 11.0 "British Columbia" 10.0 4.0 * Use the NAMEFMT and FORMAT commands to PRINT the data. namefmt(1X,A8,3X,2A5) format(1X,A8,2X,2F5.1) print province ur vr / format * Example 2 - Character variable has no blanks read province ur vr / charvars=1 Newfoundland 14.9 4.0 NovaScotia 9.1 5.0 NewBrunswick 12.2 7.0 Quebec 9.1 6.0 Ontario 7.1 5.0 Manitoba 6.7 8.0 Saskatchewan 4.8 8.0 Alberta 5.3 11.0 BritishColumbia 10.0 4.0 print ur vr * Example 3 - Use of FORMAT command format(2a8,2f5.1) * Use the FORMAT option on the READ command read prov1 prov2 ur vr / format Newfoundland 14.9 4.0 Nova Scotia 9.1 5.0 New Brunswick 12.2 7.0 Quebec 9.1 6.0 Ontario 7.1 5.0 Manitoba 6.7 8.0 Saskatchewan 4.8 8.0 Alberta 5.3 11.0 British Columbia 10.0 4.0 format(1X,2A8,2F5.1) print prov1 prov2 ur vr / format nonames STOP