BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cruise
Ammonite | Level 13

Hi Folks:

I have about 260 ZIP codes that I'd like to input as a single column data. But the code below would input only first row from 10504 until 10604 and stop there.

How to input all ZIP codes? The resulting data needs to have one variable named ZIP and about 260 rows. 

 

data zips;
input zip $5.;
cards;
10504 10505 10506 10509 10512 10520 10543 10551 10566 10595 10604 
10706 10901 10924 10926 10940 10954 10960 10962 10965 10977 10980 
10990 10994 11010 11020 11021 11040 11042 11050 11501 11520 11530 
11542 11545 11547 11550 11552 11557 11566 11572 11575 11581 11590 
11702 11704 11706 11714 11717 11722 11729 11731 11735 11741 11747 
11752 11757 11758 11776 11780 11788 11791 11793 11798 11801 11803 
11804 11901 11937 11952 11963 11967 11978 12010 12020 12025 12051 
12061 12078 12085 12095 12123 12144 12150 12151 12170 12175 12176 
12180 12182 12185 12188 12189 12198 12205 12208 12212 12303 12306 
12309 12345 12401 12422 12423 12440 12462 12466 12477 12482 12498 
12508 12514 12518 12524 12528 12538 12543 12546 12550 12553 12561 
12564 12569 12570 12578 12589 12590 12601 12602 12603 12764 12803 
12828 12866 12887 12919 12921 12933 12958 12962 13021 13041 13045 
13057 13066 13069 13072 13073 13082 13088 13120 13136 13138 13155 
13160 13165 13166 13206 13208 13213 13214 13221 13316 13323 13340 
13357 13365 13367 13413 13431 13492 13493 13501 13502 13503 13601 
13619 13630 13653 13658 13662 13732 13748 13760 13790 13795 13801 
13812 13827 13833 13838 13844 13850 13858 13902 13903 13904 13905 
14009 14027 14043 14048 14052 14059 14065 14066 14070 14086 14092 
14094 14098 14101 14103 14107 14120 14132 14150 14202 14206 14207 
14211 14213 14215 14225 14227 14302 14303 14304 14305 14411 14420 
14423 14424 14427 14429 14432 14433 14441 14443 14445 14454 14470 
14482 14485 14502 14527 14559 14564 14568 14569 14580 14606 14607 
14610 14611 14613 14615 14620 14623 14624 14701 14731 14733 14738 
14745 14755 14760 14813 14840 14843 14845 14850 14882 14891 14895 
14903
;
1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star
data zips;
input zip : $5. @@;
cards;
10504 10505 10506 10509 10512 10520 10543 10551 10566 10595 10604 
10706 10901 10924 10926 10940 10954 10960 10962 10965 10977 10980 
10990 10994 11010 11020 11021 11040 11042 11050 11501 11520 11530 
11542 11545 11547 11550 11552 11557 11566 11572 11575 11581 11590 
11702 11704 11706 11714 11717 11722 11729 11731 11735 11741 11747 
11752 11757 11758 11776 11780 11788 11791 11793 11798 11801 11803 
11804 11901 11937 11952 11963 11967 11978 12010 12020 12025 12051 
12061 12078 12085 12095 12123 12144 12150 12151 12170 12175 12176 
12180 12182 12185 12188 12189 12198 12205 12208 12212 12303 12306 
12309 12345 12401 12422 12423 12440 12462 12466 12477 12482 12498 
12508 12514 12518 12524 12528 12538 12543 12546 12550 12553 12561 
12564 12569 12570 12578 12589 12590 12601 12602 12603 12764 12803 
12828 12866 12887 12919 12921 12933 12958 12962 13021 13041 13045 
13057 13066 13069 13072 13073 13082 13088 13120 13136 13138 13155 
13160 13165 13166 13206 13208 13213 13214 13221 13316 13323 13340 
13357 13365 13367 13413 13431 13492 13493 13501 13502 13503 13601 
13619 13630 13653 13658 13662 13732 13748 13760 13790 13795 13801 
13812 13827 13833 13838 13844 13850 13858 13902 13903 13904 13905 
14009 14027 14043 14048 14052 14059 14065 14066 14070 14086 14092 
14094 14098 14101 14103 14107 14120 14132 14150 14202 14206 14207 
14211 14213 14215 14225 14227 14302 14303 14304 14305 14411 14420 
14423 14424 14427 14429 14432 14433 14441 14443 14445 14454 14470 
14482 14485 14502 14527 14559 14564 14568 14569 14580 14606 14607 
14610 14611 14613 14615 14620 14623 14624 14701 14731 14733 14738 
14745 14755 14760 14813 14840 14843 14845 14850 14882 14891 14895 
14903
;
run;

View solution in original post

2 REPLIES 2
SASKiwi
PROC Star
data zips;
input zip : $5. @@;
cards;
10504 10505 10506 10509 10512 10520 10543 10551 10566 10595 10604 
10706 10901 10924 10926 10940 10954 10960 10962 10965 10977 10980 
10990 10994 11010 11020 11021 11040 11042 11050 11501 11520 11530 
11542 11545 11547 11550 11552 11557 11566 11572 11575 11581 11590 
11702 11704 11706 11714 11717 11722 11729 11731 11735 11741 11747 
11752 11757 11758 11776 11780 11788 11791 11793 11798 11801 11803 
11804 11901 11937 11952 11963 11967 11978 12010 12020 12025 12051 
12061 12078 12085 12095 12123 12144 12150 12151 12170 12175 12176 
12180 12182 12185 12188 12189 12198 12205 12208 12212 12303 12306 
12309 12345 12401 12422 12423 12440 12462 12466 12477 12482 12498 
12508 12514 12518 12524 12528 12538 12543 12546 12550 12553 12561 
12564 12569 12570 12578 12589 12590 12601 12602 12603 12764 12803 
12828 12866 12887 12919 12921 12933 12958 12962 13021 13041 13045 
13057 13066 13069 13072 13073 13082 13088 13120 13136 13138 13155 
13160 13165 13166 13206 13208 13213 13214 13221 13316 13323 13340 
13357 13365 13367 13413 13431 13492 13493 13501 13502 13503 13601 
13619 13630 13653 13658 13662 13732 13748 13760 13790 13795 13801 
13812 13827 13833 13838 13844 13850 13858 13902 13903 13904 13905 
14009 14027 14043 14048 14052 14059 14065 14066 14070 14086 14092 
14094 14098 14101 14103 14107 14120 14132 14150 14202 14206 14207 
14211 14213 14215 14225 14227 14302 14303 14304 14305 14411 14420 
14423 14424 14427 14429 14432 14433 14441 14443 14445 14454 14470 
14482 14485 14502 14527 14559 14564 14568 14569 14580 14606 14607 
14610 14611 14613 14615 14620 14623 14624 14701 14731 14733 14738 
14745 14755 14760 14813 14840 14843 14845 14850 14882 14891 14895 
14903
;
run;
Cruise
Ammonite | Level 13
Thanks a lot!!!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 374 views
  • 1 like
  • 2 in conversation