Hi, I am trying to import a .csv file saved on my local machine onto SAS server. The import is successful if I use File>Import Data> from the menu. But when I try to write a code, the import fails error 'Device is offiline'
Code is as follows:
data sasuser.AMAT_87_ASK_TRIAL;
infile 'E:/*/*/*/AMAT+ISSM (1987-92)/AMAT 1987//AMAT_87_ASK.csv'
delimiter = ','
firstobs = 2
lrecl=32767
dsd
missover;
LENGTH
XA 8
ASK 8
ASKSIZE 8
SELLTIME 8
VOLS 8
ALAMBDA 8
AMU 8
TQ $1
REGIMEASK 8
OLDINDEX 8
VOLSOLD 8
PROBS 8 ;
FORMAT
XA BEST4.
ASK BEST6.
ASKSIZE BEST6.
SELLTIME TIME8.
VOLS BEST6.
ALAMBDA BEST12.
AMU BEST12.
TQ $CHAR1.
REGIMEASK BEST3.
OLDINDEX BEST4.
VOLSOLD BEST6.
PROBS BEST11. ;
INFORMAT
XA BEST4.
ASK BEST6.
ASKSIZE BEST6.
SELLTIME TIME8.
VOLS BEST6.
ALAMBDA BEST12.
AMU BEST12.
TQ $CHAR1.
REGIMEASK BEST3.
OLDINDEX BEST4.
VOLSOLD BEST6.
PROBS BEST11. ;
INPUT
XA : ?? BEST4.
ASK : ?? COMMA6.
ASKSIZE : ?? BEST6.
SELLTIME : ?? TIME8.
VOLS : ?? BEST6.
ALAMBDA : ?? COMMA12.
AMU : ?? COMMA12.
TQ : $CHAR1.
REGIMEASK : ?? BEST3.
OLDINDEX : ?? BEST4.
VOLSOLD : ?? BEST6.
PROBS : ?? COMMA11. ;
run;
LOG
ERROR: Device is offline.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set SASUSER.AMAT_87_ASK_TRIAL may be incomplete. When this step was stopped there were 0 observations and 12
variables.
WARNING: Data set SASUSER.AMAT_87_ASK_TRIAL was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
File - Import imports from the local environment.
Code, OTOH, is executed directly on the server, and you must make sure that the path you use on the local machine is also available there.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.