About 600 results
Open links in new tab
  1. Solved: 5 digit zip code - SAS Support Communities

    Oct 7, 2015 · Solved: Hi all One variable in my data set is zip code. It should be a 5 digit number, but of course, for some records it's text, for example,

  2. Extract First 5 Characters of String Variable with Varying Lengths

    Aug 8, 2017 · I have a zip code variable in a dataset that includes both 5- and 9-digit zip codes. I want all of them to be 5-digits but am having trouble extracting the first 5 digits of the variable. …

  3. converting numeric zip codes of varying lengths

    May 16, 2025 · I've got numeric zip code values of various length. I used z format in the example below. It worked for value that was 2 digits but I got weird results for the ones longer than 5. Is …

  4. use length, index, and substr for zipcode variable

    Dec 1, 2019 · It reads zip codes in the form 07417 or 07417-1280 Create variable_9digit. It equals 1 if zipcode has a hyphen separating the fifth and seven digits. Otherwise it equals 0. Write the …

  5. Adding Leading Zero to Character Variable - SAS Communities

    Nov 14, 2021 · Solved: Hi all, I'm setting the zip code to be a 5-digit character variable, and adding a leading zero if there are only 4 digits. data survey;

  6. Trying to Convert Zip Code to Time Zone - Best way to do it?

    Sep 12, 2023 · Hi all, I'm trying to merge zip code and time zone into one dataset and am wondering of the best way to do it. I have two datasets - one that has a zip code variable and …

  7. How to calculate the distance between two 9 digits zip code?

    Aug 24, 2020 · The function zipcitydistance uses sashelp.zip (as documented) and that dataset contains only the five digit zip codes. So you need another function and data-source to …

  8. Can we determine time zone from a US address? - SAS Communities

    Mar 13, 2020 · That has Timezone name for the 5 digit Zip code if you have that as part of your address. Or the same data set has most city and town names (not many cross time zones).

  9. Transform Data by Zip Code into US Regions - SAS Communities

    Jun 6, 2012 · I have a data set that is listed out by zip code as the mapping coordinate but I would like to group those zip codes into a small number of regions (say 5 or 10). Is there a way to do …

  10. Solved: how to pad character variable with leading zeroes? - SAS ...

    Mar 29, 2011 · 12345 12345 1234 123456789 I want to get a single variable with: first 6 digit from 9 digit zip var; add leading zero where there is 1 less digit zip and keep 6 digit zip value as it …