How can I automatically read this file
http://www.nanpa.com/nanp1/allutlzd.zip
in SAS?
the code below is not working !
filename allstate url "http://www.nanpa.com/nanp1/allutlzd.zip" ;
data urlall;
LENGTH
State $ 2
'NPA-NXX'n $ 7
OCN $ 4
Company $ 50
RateCenter $ 10
EffectiveDate 8
Use $ 2
AssignDate 8
'Initial/Growth'n $ 1
'Pooled Code File Updated 04/06/2'n $ 1 ;
LABEL
'Pooled Code File Updated 04/06/2'n = "Pooled Code File Updated 04/06/2017" ;
FORMAT
State $CHAR2.
'NPA-NXX'n $CHAR7.
OCN $CHAR4.
Company $CHAR50.
RateCenter $CHAR10.
EffectiveDate MMDDYY10.
Use $CHAR2.
AssignDate MMDDYY10.
'Initial/Growth'n $CHAR1.
'Pooled Code File Updated 04/06/2'n $CHAR1. ;
INFORMAT
State $CHAR2.
'NPA-NXX'n $CHAR7.
OCN $CHAR4.
Company $CHAR50.
RateCenter $CHAR10.
EffectiveDate MMDDYY10.
Use $CHAR2.
AssignDate MMDDYY10.
'Initial/Growth'n $CHAR1.
'Pooled Code File Updated 04/06/2'n $CHAR1. ;
INFILE allstate MISSOVER DLM=' ' DSD FIRSTOBS=2 ;
INPUT
State : $CHAR2.
'NPA-NXX'n : $CHAR7.
OCN : $CHAR4.
Company : $CHAR50.
RateCenter : $CHAR10.
EffectiveDate : ?? MMDDYY10.
Use : $CHAR2.
AssignDate : ?? MMDDYY10.
'Initial/Growth'n : $CHAR1.
'Pooled Code File Updated 04/06/2'n : $CHAR1. ;
run;
Include a call to proc http! Here is blog from @Chris describing the method: http://blogs.sas.com/content/sasdummy/2014/01/29/using-filename-zip/
Art, CEO, AnalystFinder.com
Include a call to proc http! Here is blog from @Chris describing the method: http://blogs.sas.com/content/sasdummy/2014/01/29/using-filename-zip/
Art, CEO, AnalystFinder.com
It works.
Ty Art.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.