I always have to re-run my whole code to get to the point I previously stopped my work, since every time I try to open the dataset I saved on my permanent folder I get the following error:"ERROR:Unable to open the table WCB.RightData. WCB.RightData cannot be opened. Do you want to select a different table to open?"
The weird thing is that if I do not close my syntax and I open the table on my permanent folder, it is there with the data. However, When I closed SAS and re-open SAS and import the data, I get the error above.
Here is my code when I created the SAS dataset and saved on my permanent folder:
LIBNAME WCB "\\Mac\Home\Desktop\WCB Data\Data analysis";
PROC IMPORT OUT= WCB.WCB20032014
DATAFILE= "\\Mac\Home\Desktop\WCB Data\Raw Data\SPSS Original files\Shoulders (2).sav"
DBMS=SPSS REPLACE;
RUN;
By using the code above the SAS database is created and I can see the table with the data. However, when I close SAS and re-open it, every time I import the SAS dataset I created, I get the error above.
Here is the code I used when I am trying to open the SAS dataset I created with the previously code:
LIBNAME WCB "\\Mac\Home\Desktop\WCB Data\Data analysis";
The dataset is there, but I get the error I described previously and cannot see the information on the table. The dataset is empty.
Any help would be greatly appreciated.
Thanks!
Anelise
Can you show us the LOG from an instance where this happens. Include the code and all of the notes, messages, and/or warnings. Copy the text from the log, on the forum open a text box with the </> icon above the message window and paste the text. The text box preserves any formatting. The main message windows on this forum reformat pasted text and may introduce or remove something of interest.
I am not at all sure what you mean by "if I do not close my syntax".
One question might be why are you re-importing a file that you already have read?
It is confusing to mention that your message says ":"ERROR:Unable to open the table WCB.RightData." but your CODe shows "OUT= WCB.WCB20032014" which is not the same set at all. That makes it seem that perhaps WCB.RightData was built with different code.
Suggestion. In a new SAS session run ONLY the libname statement. Then run this code to generate a description of the sets in your library:
Proc contents data=WCB._all_ details; run;
Capture the results and post that on the forum.
NOTE: Copyright (c) 2016 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.4 (TS1M7) Licensed to UNIVERSITY OF ALBERTA, Site 70081436. NOTE: This session is executing on the X64_10HOME platform. NOTE: Analytical products: SAS/STAT 15.2 SAS/ETS 15.2 SAS/OR 15.2 SAS/IML 15.2 SAS/QC 15.2 NOTE: Additional host information: X64_10HOME WIN 10.0.22000 Workstation NOTE: SAS initialization used: real time 1.22 seconds cpu time 0.96 seconds 1 LIBNAME WCB "\\Mac\Home\Desktop\WCB Data\Data analysis"; NOTE: Libref WCB was successfully assigned as follows: Engine: V9 Physical Name: \\Mac\Home\Desktop\WCB Data\Data analysis 2 Proc contents data=WCB._all_ details; NOTE: Writing HTML Body file: sashtml.htm 3 run; NOTE: PROCEDURE CONTENTS used (Total process time): real time 0.34 seconds cpu time 0.23 seconds 4 proc sort data= WCB20032014 out = srt20032014; ERROR: File WORK.WCB20032014.DATA does not exist. 5 by ClaimID; 6 run; NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.SRT20032014 may be incomplete. When this step was stopped there were 0 observations and 0 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.01 seconds cpu time 0.03 seconds
Thanks for the code; however as you can see in the log, when I run the details it showed the data. However, when I tried to work on the data, I am unable and it stated that the dataset doesn’t exist.
Thanks!
PROC IMPORT OUT= WCB.WCB20032014
proc sort data= WCB20032014 out = srt20032014;
Can you spot the difference?
LIBNAME WCB "\\Mac\Home\Desktop\WCB Data\Data analysis"; NOTE: Libref WCB was successfully assigned as follows: Engine: V9 Physical Name: \\Mac\Home\Desktop\WCB Data\Data analysis 2 proc sort data= Wcb.WCB20032014 out = Wcb.srt20032014; 3 by ClaimID; 4 run; NOTE: There were 5729 observations read from the data set WCB.WCB20032014. NOTE: The data set WCB.SRT20032014 has 5729 observations and 319 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.05 seconds cpu time 0.03 seconds ERROR: Format ADMJOB not found or couldn't be loaded for variable ADMJOB. ERROR: Format ADMSTAT not found or couldn't be loaded for variable admstat. ERROR: Format BACK not found or couldn't be loaded for variable BACK. ERROR: Format CASECON not found or couldn't be loaded for variable CASECON2. ERROR: Format CASECO1A not found or couldn't be loaded for variable CASECON5. ERROR: Format CASEDAT not found or couldn't be loaded for variable CASEDAT5. ERROR: Format CMPLXLO not found or couldn't be loaded for variable CMPLXLOS. ERROR: Format COMLOS not found or couldn't be loaded for variable COMLOS. ERROR: Format CONTYPE not found or couldn't be loaded for variable CONTYPE. ERROR: Format CURWORK not found or couldn't be loaded for variable CURWORK. ERROR: Format DIS not found or couldn't be loaded for variable dis. ERROR: Format DISJOB not found or couldn't be loaded for variable DISJOB. ERROR: Format DISREAS not found or couldn't be loaded for variable DISREAS. ERROR: Format DREC1A not found or couldn't be loaded for variable DREC1. ERROR: Format DREC2A not found or couldn't be loaded for variable DREC2. ERROR: Format DREC3A not found or couldn't be loaded for variable DREC3. ERROR: Format DRECOM not found or couldn't be loaded for variable DRECOM. ERROR: Format EDUCATI not found or couldn't be loaded for variable EDUCATIN. ERROR: Format EMPPOS not found or couldn't be loaded for variable EMPPOS. ERROR: Format EMPTYPE not found or couldn't be loaded for variable EMPTYPE. ERROR: Format FOLLINT not found or couldn't be loaded for variable FOLLINT. ERROR: Format FTW1A not found or couldn't be loaded for variable FTW1. ERROR: Format FTWDUR not found or couldn't be loaded for variable FTWDUR. ERROR: Format FTWLEVE not found or couldn't be loaded for variable FTWLEVEL. ERROR: Format FTWREST not found or couldn't be loaded for variable FTWRESTR. ERROR: Format GENDER not found or couldn't be loaded for variable GENDER. ERROR: Format GROUP not found or couldn't be loaded for variable GROUP. ERROR: Format INTERP not found or couldn't be loaded for variable INTERP. ERROR: Format IVRAPPR not found or couldn't be loaded for variable IVRAPPR. ERROR: Format JOBVOCP not found or couldn't be loaded for variable JOBVOCP. ERROR: Format MARRIED not found or couldn't be loaded for variable MARRIED. ERROR: Format MEDCON2A not found or couldn't be loaded for variable MEDCON2. ERROR: Format MODAVAI not found or couldn't be loaded for variable modavail. ERROR: Format MODLEVE not found or couldn't be loaded for variable MODLEVEL. ERROR: Format NOCA not found or couldn't be loaded for variable noca. ERROR: Format NPROGRE not found or couldn't be loaded for variable NPROGRES. ERROR: Format NSHOCAN not found or couldn't be loaded for variable NSHOCAN. ERROR: Format ONPROGR not found or couldn't be loaded for variable ONPROGRAM. ERROR: Format OUTCOME not found or couldn't be loaded for variable OUTCOME. ERROR: Format PROG not found or couldn't be loaded for variable PROG. ERROR: Format PROGCOM not found or couldn't be loaded for variable progcomb. ERROR: Format PROGCO1A not found or couldn't be loaded for variable PROGCOMP. ERROR: Format PROJLOS not found or couldn't be loaded for variable PROJLOS. ERROR: Format PROV not found or couldn't be loaded for variable PROV. ERROR: Format PROVGRP not found or couldn't be loaded for variable provgrp. ERROR: Format READM not found or couldn't be loaded for variable READM. ERROR: Format RTW1A not found or couldn't be loaded for variable RTW1. ERROR: Format RTWDUR not found or couldn't be loaded for variable RTWDUR. ERROR: Format RTWLEVE not found or couldn't be loaded for variable RTWLEVEL. ERROR: Format RTWPMAS not found or couldn't be loaded for variable RTWPMASM. ERROR: Format RTWREST not found or couldn't be loaded for variable RTWRESTR. ERROR: Format SELFTYP not found or couldn't be loaded for variable SELFTYPE. ERROR: Format TD not found or couldn't be loaded for variable TD. ERROR: Format TD30A not found or couldn't be loaded for variable TD30. ERROR: Format TD60A not found or couldn't be loaded for variable TD60. ERROR: Format TD90A not found or couldn't be loaded for variable TD90. ERROR: Format TDONPRO not found or couldn't be loaded for variable tdonprog1. ERROR: Format TDSTATS not found or couldn't be loaded for variable TDSTATS. ERROR: Format TDSTATU not found or couldn't be loaded for variable TDSTATUS. ERROR: Format TDSTAT1A not found or couldn't be loaded for variable TDSTATUS60. ERROR: Format TDSTAT2A not found or couldn't be loaded for variable TDSTATUS90. ERROR: Format TRANSFE not found or couldn't be loaded for variable TRANSFER. ERROR: Format UNION not found or couldn't be loaded for variable union. ERROR: Format VOCPASS not found or couldn't be loaded for variable VOCPASSM. ERROR: Format VRINTEG not found or couldn't be loaded for variable VRINTEG. ERROR: Format WORKVIS not found or couldn't be loaded for variable WORKVIS. ERROR: Format BRAININ not found or couldn't be loaded for variable braininj. ERROR: Format CLIN100A not found or couldn't be loaded for variable clin100km. ERROR: Format DELAY not found or couldn't be loaded for variable delay. ERROR: Format DIAG_GR not found or couldn't be loaded for variable Diag_Grp. ERROR: Format FATALIT not found or couldn't be loaded for variable Fatality. ERROR: Format SHOULDE not found or couldn't be loaded for variable shoulder. ERROR: Format OMPQ2P not found or couldn't be loaded for variable OMPQ2p. ERROR: Format OMPQ3P not found or couldn't be loaded for variable OMPQ3p. ERROR: Format OMPQ4P not found or couldn't be loaded for variable OMPQ4p. ERROR: Format OMPQ5P not found or couldn't be loaded for variable OMPQ5p. ERROR: Format OMPQ6P not found or couldn't be loaded for variable OMPQ6p. ERROR: Format OMPQ7P not found or couldn't be loaded for variable OMPQ7p.
So the dataset is found, but you miss the custom formats used in the dataset. Either rerun the code which creates the formats, or set the FMTSEARCH= system option so they can be found.
Thanks all, the FORMAT makes sense. I will be working in this data tomorrow again and I will try to use the format syntaxes provided and hopefully it will work out.
Thanks again for taking your time to help me out,
Anelise
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.