05-26-2017 12:43 PM
here is the error when I read this data. there are no observations. Why ?
filename data '\\kashmir\BFD\sample_json1_may26.txt';
6300 data datatest;
6301 infile data lrecl = 32000 truncover scanover;
6302 input @'"text": "' text $255. @'"from_user": "' from_user $255. @'"created_at": "' created_at
6302! $255. ;
6303 /*text = substr(text,1,index(text,'",')-2); from_user = substr( from_user,1,index(
6304 created_at = substr(created_at,1,index(created_at,'",')-2); run;
NOTE: The infile DATA is:
RECFM=V,LRECL=32000,File Size (bytes)=1989,
NOTE: 3 records were read from the infile DATA.
The minimum record length was 1.
The maximum record length was 1134.
NOTE: SAS went to a new line when INPUT @'CHARACTER_STRING' scanned past the end of a line.
NOTE: The data set WORK.DATATEST has 0 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
6306 proc print data=dataset;run;
ERROR: File WORK.DATASET.DATA does not exist.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
05-26-2017 07:06 PM
Without actually seeing the data file here is something to check:
When using the Input @'text value' then the value you supply in the code must be exactly as it appears in the source file.
If the file has "Text value" then it does not match 'text value'
Also the "Minimum record length was 1" may indicate you don't even want to attempt the read the first line. Perhaps add "firstobs=2" to accomplish that.