BookmarkSubscribeRSS Feed
susana3
Fluorite | Level 6

Hello, I am trying to import a .dat file into SAS using Amazon App Stream 2.0. 

The first three lines of code are:

LIBNAME sas8 v8 'C:\Users\PhotonUser\My Files\OneDrive\Files';

FILENAME INPUTDAT 'p08putm2.dat' ;
DATA sas8.p08putm2 ;

 

and the log file says 

LIBNAME sas8 v8 'C:\Users\PhotonUser\My Files\OneDrive\Files';
NOTE: Libref SAS8 was successfully assigned as follows:
Engine: V8
Physical Name: C:\Users\PhotonUser\My Files\OneDrive\Files
FILENAME INPUTDAT 'p08putm2.dat' ;

DATA sas8.p08putm2 ; 

which gives me the impression that these three lines were run and understood by SAS 

 

But when I run the following code, 

INFILE INPUTDAT PAD LRECL=885 ;
INPUT
SSUSEQ 1- 5...

FILLER 884- 884
;
RUN ;

I get the following error message

ERROR: Physical file does not exist, C:\Users\PhotonUser\p08putm2.dat.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set SAS8.P08PUTM2 may be incomplete. When this step was stopped there were 0
observations and 429 variables.
WARNING: Data set SAS8.P08PUTM2 was not replaced because this step was stopped.

 

Can you please help? Thanks a lot!

7 REPLIES 7
PaigeMiller
Diamond | Level 26

Can you show us the entire LOG for these steps? That is, we need to see all of the code that appears in the LOG, plus all NOTEs, WARNINGs and ERRORs, in sequence, with nothing chopped out. Please format the log properly by copying it as text and pasting it into the window that appears when you click on the </> icon? DO NOT SKIP THIS STEP! Thanks!

--
Paige Miller
ballardw
Super User

What SAS did with the FILENAME statement was assume a path to the file because you did not provide one.

It is a good idea to provide a full path for any filename because otherwise SAS will default to using a different directory and seldom the one where that file actually is. Until you attempt to read from the file SAS just makes a link to a location. The Filename is also used to create output files so SAS does not know that you are going to read from that file so does not actually check if it exists.

 

Perhaps (or the full path to where that .DAT file resides):

FILENAME INPUTDAT 'C:\Users\PhotonUser\My Files\OneDrive\Files\p08putm2.dat' ;
Reeza
Super User

1. You cannot run your code partially as you're mentioning - you need to run it for each "block" of code but your code is currently broken in the middle. 

 

You have three "blocks" of code, a libname, a filename and a data step. Run them all at once and post the log:

 

*creates a library reference to permanenly store data sets;
LIBNAME myFiles  'C:\Users\PhotonUser\My Files\OneDrive\Files';

*creates a reference to the file to import, use full paths initially;
FILENAME INPUTDAT 'C:\Users\PhotonUser\My Files\OneDrive\Files\p08putm2.dat' ;


*reads two variables from the file, SSUSEG and FILLER;
DATA myFiles.p08putm2 ; 
INFILE INPUTDAT PAD LRECL=885 ;
INPUT SSUSEQ 1- 5 FILLER 884- 884;
RUN ;

@susana3 wrote:

Hello, I am trying to import a .dat file into SAS using Amazon App Stream 2.0. 

The first three lines of code are:

LIBNAME sas8 v8 'C:\Users\PhotonUser\My Files\OneDrive\Files';

FILENAME INPUTDAT 'p08putm2.dat' ;
DATA sas8.p08putm2 ;

 

and the log file says 

LIBNAME sas8 v8 'C:\Users\PhotonUser\My Files\OneDrive\Files';
NOTE: Libref SAS8 was successfully assigned as follows:
Engine: V8
Physical Name: C:\Users\PhotonUser\My Files\OneDrive\Files
FILENAME INPUTDAT 'p08putm2.dat' ;

DATA sas8.p08putm2 ; 

which gives me the impression that these three lines were run and understood by SAS 

 

But when I run the following code, 

INFILE INPUTDAT PAD LRECL=885 ;
INPUT
SSUSEQ 1- 5...

FILLER 884- 884
;
RUN ;

I get the following error message

ERROR: Physical file does not exist, C:\Users\PhotonUser\p08putm2.dat.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set SAS8.P08PUTM2 may be incomplete. When this step was stopped there were 0
observations and 429 variables.
WARNING: Data set SAS8.P08PUTM2 was not replaced because this step was stopped.

 

Can you please help? Thanks a lot!


 

susana3
Fluorite | Level 6

Hi again, I have run the coded and now I get a different error message. See the log report below 

 

1 LIBNAME sas8 v8 'C:\Users\PhotonUser\My Files\OneDrive';
NOTE: Libref SAS8 was successfully assigned as follows:
Engine: V8
Physical Name: C:\Users\PhotonUser\My Files\OneDrive
2 FILENAME INPUTDAT 'C:\Users\PhotonUser\My Files\OneDrive\p08putm2.dat' ;

3 LIBNAME sas8 v8 'C:\Users\PhotonUser\My Files\OneDrive';
NOTE: Libref SAS8 was successfully assigned as follows:
Engine: V8
Physical Name: C:\Users\PhotonUser\My Files\OneDrive
4 FILENAME INPUTDAT 'C:\Users\PhotonUser\My Files\OneDrive\p08putm2.dat' ;
5 DATA sas8.p08putm2 ;
6 INFILE INPUTDAT PAD LRECL=885 ;
7 INPUT
8 SSUSEQ 1- 5
9 SSUID $ 6- 17
10 SPANEL 18- 21
11 SWAVE 22- 23
12 SROTATON 24- 24
13 TFIPSST 25- 26
14 SHHADID 27- 29
15 EOUTCOME 30- 32
16 RFID 33- 35
17 RFID2 36- 38
18 EPPIDX 39- 41
19 EENTAID 42- 44
20 EPPPNUM 45- 48
21 EPOPSTAT 49- 49
22 EPPINTVW 50- 51
23 EPPMIS4 52- 52
24 ESEX 53- 53
25 ERACE 54- 54
26 EORIGIN 55- 56
27 WPFINWGT 57- 66
28 ERRP 67- 68
29 TAGE 69- 70
30 EMS 71- 71
31 EPNSPOUS 72- 75
32 EPNMOM 76- 79
33 EPNDAD 80- 83
34 EPNGUARD 84- 87
35 RDESGPNT 88- 89
36 EEDUCATE 90- 91
37 LGTKEY 92- 99
38 SINTHHID 100- 102
39 EAWKUNV 103- 104
40 ELMTVER 105- 106
41 ALMTVER 107- 107
42 ELMTMO 108- 109
43 ALMTMO 110- 110
44 TLMTYR 111- 114
45 ALMTYR 115- 115
46 ELMTEMP 116- 117
47 ALMTEMP 118- 118
48 EWKLTMO 119- 120
49 AWKLTMO 121- 121
50 TWKLTYR 122- 125
51 AWKLTYR 126- 126
52 EALLCON1 127- 128
53 EALLCON2 129- 130
54 EALLCON3 131- 132
55 EALLCON4 133- 134
56 EALLCON5 135- 136
57 EALLCON6 137- 138
58 EALLCON7 139- 140
59 EALLCON8 141- 142
60 EALLCON9 143- 144
61 EALCON10 145- 146
62 EALCON11 147- 148
63 EALCON12 149- 150
64 EALCON13 151- 152
65 EALCON14 153- 154
66 EALCON15 155- 156
67 EALCON16 157- 158
68 EALCON17 159- 160
69 EALCON18 161- 162
70 EALCON19 163- 164
71 EALCON20 165- 166
72 EALCON21 167- 168
73 EALCON22 169- 170
74 EALCON23 171- 172
75 EALCON24 173- 174
76 EALCON25 175- 176
77 EALCON26 177- 178
78 EALCON27 179- 180
79 EALCON28 181- 182
80 EALCON29 183- 184
81 EALCON30 185- 186
82 AALLCOND 187- 187
83 EMNCOND 188- 189
84 AMNCOND 190- 190
85 EMNCAUS 191- 192
86 AMNCAUS 193- 193
87 EMNLOC 194- 195
88 AMNLOC 196- 196
89 EPREVWK 197- 198
90 APREVWK 199- 199
91 EPREVBMO 200- 201
92 APREVBMO 202- 202
93 TPREVBYR 203- 206
94 APREVBYR 207- 207
95 ENOWFPT 208- 209
96 ANOWFPT 210- 210
97 ENOWOCC 211- 212
98 ANOWOCC 213- 213
99 ENOWSAME 214- 215
100 ANOWSAME 216- 216
101 EAEDUNV 217- 218
102 EADVNCFD 219- 220
103 AADVNCFD 221- 221
104 EVOCFLD 222- 223
105 AVOCFLD 224- 224
106 EASSOCFD 225- 226
107 AASSOCFD 227- 227
108 EBACHFLD 228- 229
109 ABACHFLD 230- 230
110 ECONENRL 231- 232
111 ACONENRL 233- 233
112 EGEDTM 234- 235
113 AGEDTM 236- 236
114 EPUBHS 237- 238
115 APUBHS 239- 239
116 ECOURSE1 240- 241
117 ECOURSE2 242- 243
118 ECOURSE3 244- 245
119 ECOURSE4 246- 247
120 ECOURSE5 248- 249
121 ECOURSE6 250- 251
122 ECOURSE7 252- 253
123 ACOURSE 254- 254
124 EPROGRAM 255- 256
125 APROGRAM 257- 257
126 ERCVTRN1 258- 259
127 ARCVTRN1 260- 260
128 ENUMTRN1 261- 262
129 ANUMTRN1 263- 263
130 ETRN1TIM 264- 265
131 ATRN1TIM 266- 266
132 EWEEKT1 267- 269
133 AWEEKT1 270- 270
134 EINTRN1 271- 272
135 AINTRN1 273- 273
136 EWHOTRN1 274- 275
137 AWHOTRN1 276- 276
138 ELCTNTR1 277- 278
139 ALCTNTR1 279- 279
140 ETYP1TR 280- 281
141 ATYP1TR 282- 282
142 EJBATRN1 283- 284
143 AJBATRN1 285- 285
144 ENWATRN1 286- 287
145 ANWATRN1 288- 288
146 EJBBTRN1 289- 290
147 AJBBTRN1 291- 291
148 ENWBTRN1 292- 293
149 ANWBTRN1 294- 294
150 RTRN1USE 295- 296
151 ATRN1USE 297- 297
152 ERCVTRN2 298- 299
153 ARCVTRN2 300- 300
154 ENUMTRN2 301- 302
155 ANUMTRN2 303- 303
156 ETRN2TIM 304- 305
157 ATRN2TIM 306- 306
158 EWEEKT2 307- 309
159 AWEEKT2 310- 310
160 EINTRN2 311- 312
161 AINTRN2 313- 313
162 EWHOTRN2 314- 315
163 AWHOTRN2 316- 316
164 ELCTNTR2 317- 318
165 ALCTNTR2 319- 319
166 ETYP2TR1 320- 321
167 ETYP2TR2 322- 323
168 ETYP2TR3 324- 325
169 ETYP2TR4 326- 327
170 ETYP2TR5 328- 329
171 ETYP2TR6 330- 331
172 ETYP2TR7 332- 333
173 ATYP2TR 334- 334
174 EJOBTRN2 335- 336
175 AJOBTRN2 337- 337
176 ENWTRN2 338- 339
177 ANWTRN2 340- 340
178 RTRN2USE 341- 342
179 ATRN2USE 343- 343
180 ERCVTR10 344- 345
181 ARCVTR10 346- 346
182 TLSTSCHL 347- 350
183 ALSTSCHL 351- 351
184 THSYR 352- 355
185 AHSYR 356- 356
186 TCOLLSTR 357- 360
187 ACOLLSTR 361- 361
188 TLASTCOL 362- 365
189 ALASTCOL 366- 366
190 TVOCYR 367- 370
191 AVOCYR 371- 371
192 TASSOCYR 372- 375
193 AASSOCYR 376- 376
194 TBACHYR 377- 380
195 ABACHYR 381- 381
196 TADVNCYR 382- 385
197 AADVNCYR 386- 386
198 EAMRUNV 387- 388
199 EMARPTH 389- 390
200 EXMAR 391- 392
201 AXMAR 393- 393
202 EWIDIV1 394- 395
203 AWIDIV1 396- 396
204 EWIDIV2 397- 398
205 AWIDIV2 399- 399
206 TFMYEAR 400- 403
207 AFMYEAR 404- 404
208 TFSYEAR 405- 408
209 AFSYEAR 409- 409
210 TFTYEAR 410- 413
211 AFTYEAR 414- 414
212 TSMYEAR 415- 418
213 ASMYEAR 419- 419
214 TSSYEAR 420- 423
215 ASSYEAR 424- 424
216 TSTYEAR 425- 428
217 ASTYEAR 429- 429
218 TLMYEAR 430- 433
219 ALMYEAR 434- 434
220 TLSYEAR 435- 438
221 ALSYEAR 439- 439
222 TLTYEAR 440- 443
223 ALTYEAR 444- 444
224 EAFRUNV 445- 446
225 TFRCHL 447- 448
226 AFRCHL 449- 449
227 TFRINHH 450- 451
228 AFRINHH 452- 452
229 TMOMCHL 453- 454
230 AMOMCHL 455- 455
231 EMOMLIVH 456- 457
232 AMOMLIVH 458- 458
233 TFBRTHYR 459- 462
234 AFBRTHYR 463- 463
235 TLBIRTYR 464- 467
236 ALBIRTYR 468- 468
237 EFBLIVNW 469- 470
238 AFBLIVNW 471- 471
239 ELBLIVNW 472- 473
240 ALBLIVNW 474- 474
241 EBFBCTWK 475- 476
242 ABFBCTWK 477- 477
243 EBFBWKPR 478- 479
244 ABFBWKPR 480- 480
245 EBFBPGFT 481- 482
246 ABFBPGFT 483- 483
247 TBFBWSY1 484- 487
248 ABFBWSY1 488- 488
249 EBFBSTOP 489- 490
250 ABFBSTOP 491- 491
251 EBTSIT01 492- 493
252 EBTSIT02 494- 495
253 EBTSIT03 496- 497
254 EBTSIT04 498- 499
255 EBTSIT05 500- 501
256 EBTSIT06 502- 503
257 EBTSIT07 504- 505
258 EBTSIT08 506- 507
259 EBTSIT09 508- 509
260 EBTSIT10 510- 511
261 EBTSIT11 512- 513
262 EBTSIT12 514- 515
263 EBTSIT13 516- 517
264 EBTSIT14 518- 519
265 EBTSIT15 520- 521
266 ABFBSIT 522- 522
267 EAFBST01 523- 524
268 EAFBST02 525- 526
269 EAFBST03 527- 528
270 EAFBST04 529- 530
271 EAFBST05 531- 532
272 EAFBST06 533- 534
273 EAFBST07 535- 536
274 EAFBST08 537- 538
275 EAFBST09 539- 540
276 EAFBST10 541- 542
277 EAFBST11 543- 544
278 EAFBST12 545- 546
279 EAFBST13 547- 548
280 EAFBST14 549- 550
281 EAFBST15 551- 552
282 AAFBJST 553- 553
283 EAFBWRK 554- 555
284 AAFBWRK 556- 556
285 TAFBWKY1 557- 560
286 AAFBWKY1 561- 561
287 EAFBWKFT 562- 563
288 AAFBWKFT 564- 564
289 EAFBWKHR 565- 566
290 AAFBWKHR 567- 567
291 EAFBWKEM 568- 569
292 AAFBWKEM 570- 570
293 EAFBWKPS 571- 572
294 AAFBWKPS 573- 573
295 EAFBWKPY 574- 575
296 AAFBWKPY 576- 576
297 EAFBWKSE 577- 578
298 AAFBWKSE 579- 579
299 TAFBLVYR 580- 583
300 AAFBLVYR 584- 584
301 EGRNDPR 585- 586
302 AGRNDPR 587- 587
303 RNMSTOP 588- 589
304 RNMRETWK 590- 593
305 RNMLEVEM 594- 597
306 RPREMAR 598- 599
307 EAMGUNV 600- 601
308 TPRSTATE 602- 604
309 APRSTATE 605- 605
310 EPREVRES 606- 607
311 APREVRES 608- 608
312 TBRSTATE 609- 611
313 ABRSTATE 612- 612
314 ECITIZNT 613- 614
315 ACITIZNT 615- 615
316 ENATCITT 616- 617
317 ANATCITT 618- 618
318 TIMSTAT 619- 620
319 AIMSTAT 621- 621
320 EADJUST 622- 623
321 AADJUST 624- 624
322 TMOVYRYR 625- 628
323 AMOVYRYR 629- 629
324 TOUTINYR 630- 633
325 AOUTINYR 634- 634
326 TMOVEST 635- 638
327 AMOVEST 639- 639
328 TADYEAR 640- 643
329 AADYEAR 644- 644
330 TMOVEUS 645- 648
331 AMOVEUS 649- 649
332 EPREVTEN 650- 651
333 APREVTEN 652- 652
334 EPRLUNV 653- 654
335 ERELAT01 655- 656
336 ARELAT01 657- 657
337 EPRLPN01 658- 661
338 ERELAT02 662- 663
339 ARELAT02 664- 664
340 EPRLPN02 665- 668
341 ERELAT03 669- 670
342 ARELAT03 671- 671
343 EPRLPN03 672- 675
344 ERELAT04 676- 677
345 ARELAT04 678- 678
346 EPRLPN04 679- 682
347 ERELAT05 683- 684
348 ARELAT05 685- 685
349 EPRLPN05 686- 689
350 ERELAT06 690- 691
351 ARELAT06 692- 692
352 EPRLPN06 693- 696
353 ERELAT07 697- 698
354 ARELAT07 699- 699
355 EPRLPN07 700- 703
356 ERELAT08 704- 705
357 ARELAT08 706- 706
358 EPRLPN08 707- 710
359 ERELAT09 711- 712
360 ARELAT09 713- 713
361 EPRLPN09 714- 717
362 ERELAT10 718- 719
363 ARELAT10 720- 720
364 EPRLPN10 721- 724
365 ERELAT11 725- 726
366 ARELAT11 727- 727
367 EPRLPN11 728- 731
368 ERELAT12 732- 733
369 ARELAT12 734- 734
370 EPRLPN12 735- 738
371 ERELAT13 739- 740
372 ARELAT13 741- 741
373 EPRLPN13 742- 745
374 ERELAT14 746- 747
375 ARELAT14 748- 748
376 EPRLPN14 749- 752
377 ERELAT15 753- 754
378 ARELAT15 755- 755
379 EPRLPN15 756- 759
380 ERELAT16 760- 761
381 ARELAT16 762- 762
382 EPRLPN16 763- 766
383 ERELAT17 767- 768
384 ARELAT17 769- 769
385 EPRLPN17 770- 773
386 ERELAT18 774- 775
387 ARELAT18 776- 776
388 EPRLPN18 777- 780
389 ERELAT19 781- 782
390 ARELAT19 783- 783
391 EPRLPN19 784- 787
392 ERELAT20 788- 789
393 ARELAT20 790- 790
394 EPRLPN20 791- 794
395 ERELAT21 795- 796
396 ARELAT21 797- 797
397 EPRLPN21 798- 801
398 ERELAT22 802- 803
399 ARELAT22 804- 804
400 EPRLPN22 805- 808
401 ERELAT23 809- 810
402 ARELAT23 811- 811
403 EPRLPN23 812- 815
404 ERELAT24 816- 817
405 ARELAT24 818- 818
406 EPRLPN24 819- 822
407 ERELAT25 823- 824
408 ARELAT25 825- 825
409 EPRLPN25 826- 829
410 ERELAT26 830- 831
411 ARELAT26 832- 832
412 EPRLPN26 833- 836
413 ERELAT27 837- 838
414 ARELAT27 839- 839
415 EPRLPN27 840- 843
416 ERELAT28 844- 845
417 ARELAT28 846- 846
418 EPRLPN28 847- 850
419 ERELAT29 851- 852
420 ARELAT29 853- 853
421 EPRLPN29 854- 857
422 ERELAT30 858- 859
423 ARELAT30 860- 860
424 EPRLPN30 861- 864
425 EATRUNV 865- 866
426 EREBATE 867- 868
427 AREBATE 869- 869
428 ERBAMTH 870- 871
429 ARBAMTH 872- 872
430 ERBATAMT 873- 876
431 ARBATAMT 877- 877
432 ERBATTYP 878- 879
433 ARBATTYP 880- 880
434 EREBATOC 881- 882
435 AREBATOC 883- 883
436 FILLER 884- 884
437 ;
438 RUN ;

ERROR: User does not have appropriate authorization level for library SAS8.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.47 seconds
cpu time 0.25 seconds

 

Reeza
Super User
Why are you creating a V8 library? What happens if you run the code as I posted?
V8 is a very old version, it doesn't make sense to follow a 20+ year old version?
susana3
Fluorite | Level 6

This is a good observation. I am not a SAS user, so I did what the code provided by the survey (SIPP: https://www.census.gov/programs-surveys/sipp/data/datasets/2008-panel/wave-2.html) said, but it seems they probably have another website where they have updated the code. Thanks for your suggestion. I will look into this further. 

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
  • 7 replies
  • 653 views
  • 0 likes
  • 5 in conversation