Re: Problem with filename extensions, PROC COPY etc. #3

  • Follow


That looks like a mixture of V8 and V6 libraries and datsets!
The variable names in V6 where max 8 chars long, so if you convert from V8
to V6 it is necessary to truncate them, otherwise they would not be
accessible in V6.
Unfortunately you can access the same library with different engines under
windows (not under MVS!). I assume, that your extension is NOT SD7, but
SD2! That's a V6-dataset. So you copy a V8-dataset into a V6-dataset, SAS
is aware of that and truncates the variable names (otherwise that would not
be a valid V6-DS).
What I would do:
- NEVER mix V6 and V8 datasets in one library (subdirectory).
- if you don't have V6 any more: convert all your datasets to V8, make a
backup of your V6-libraries and delete them.

After that you will not have any problems with copy and contents.




On Thu, 2 Oct 2003 09:28:33 -0400, Peter Flom <flom@NDRI.ORG> wrote:

>Hello
>
>I've just started using PROC COPY to move data sets so they can be read
>by another program (R).  But I am running into an odd problem.
>
>When I use PROC COPY, the data set has to have a .sas7bdat (not .sd7
>extension, or else the file isn't found.
>
>But when I use PROC CONTENTS, the data set has to have a .sd7
>extension, or it isn't read.
>
>In addition, PROC COPY seems to truncate variable names.  Below is a
>log for details
>
>START OF LOG
>
>
>66   libname mydata 'c:\ndri\cvar\data';
>NOTE: Directory for library MYDATA contains files of mixed engine
>types.
>NOTE: Libref MYDATA was successfully assigned as follows:
>      Engine:        V8
>      Physical Name: c:\ndri\cvar\data
>67   libname tran xport 'c:\ndri\cvar\data\ufdsidu';
>NOTE: Libref TRAN was successfully assigned as follows:
>      Engine:        XPORT
>      Physical Name: c:\ndri\cvar\data\ufdsidu
>68   proc copy in = mydata out = tran memtype = data;
>69    select ufds_idu;
>70   run;
>
>NOTE: Copying MYDATA.UFDS_IDU to TRAN.UFDS_IDU (memtype=DATA).
>NOTE: The variable name _DRGTRTCTR has been truncated to _DRGTRTC.
>NOTE: The variable name NUM_CLIENTS_TRT_FOR_DRG_USE has been truncated
>to NUM_CLIE.
>NOTE: The variable name MALES_DRGTRT has been truncated to MALES_DR.
>NOTE: The variable name FE_DRGTRT has been truncated to FE_DRGTR.
>NOTE: The variable name TOTAL_DRGTRT has been truncated to TOTAL_DR.
>NOTE: The variable name __INJ_DRGTRT has been truncated to __INJ_DR.
>NOTE: The variable name __HIV__DRGTRT has been truncated to __HIV__D.
>NOTE: There were 97 observations read from the data set
>MYDATA.UFDS_IDU.
>NOTE: The data set TRAN.UFDS_IDU has 97 observations and 10 variables.
>NOTE: PROCEDURE COPY used:
>      real time           0.03 seconds
>      cpu time            0.03 seconds
>
>
>71
>72   proc contents data = cvar.ufds_idu;
>ERROR: File CVAR.UFDS_IDU.DATA does not exist.
>73   run;
>
>NOTE: Statements not processed because of errors noted above.
>NOTE: PROCEDURE CONTENTS used:
>      real time           0.01 seconds
>      cpu time            0.01 seconds
>
>NOTE: The SAS System stopped processing this step because of errors.
>74
>75   libname mydata 'c:\ndri\cvar\data';
>NOTE: Directory for library MYDATA contains files of mixed engine
>types.
>NOTE: Libref MYDATA was successfully assigned as follows:
>      Engine:        V8
>      Physical Name: c:\ndri\cvar\data
>76   libname tran xport 'c:\ndri\cvar\data\ufds96';
>NOTE: Libref TRAN was successfully assigned as follows:
>      Engine:        XPORT
>      Physical Name: c:\ndri\cvar\data\ufds96
>77
>
>
>78   proc copy in = mydata out = tran memtype = data;
>79    select ufds96;
>80   run;
>
>ERROR: The file MYDATA.UFDS96 (memtype=DATA) was not found, but appears
>on a SELECT statement.
>NOTE: Statements not processed because of errors noted above.
>NOTE: PROCEDURE COPY used:
>      real time           0.00 seconds
>      cpu time            0.00 seconds
>
>NOTE: The SAS System stopped processing this step because of errors.
>81
>
>
>82   proc contents data = cvar.ufds96;
>83   run;
>
>NOTE: PROCEDURE CONTENTS used:
>      real time           0.01 seconds
>      cpu time            0.01 seconds
>
>END OF LOG
>
>
>
>Any help appreciated
>
>Peter
>
>Peter L. Flom, PhD
>Assistant Director, Statistics and Data Analysis Core
>Center for Drug Use and HIV Research
>National Development and Research Institutes
>71 W. 23rd St
>www.peterflom.com
>New York, NY 10010
>(212) 845-4485 (voice)
>(917) 438-0894 (fax)
0
Reply ghellrieg (841) 10/2/2003 3:07:03 PM

Dear fellow SAS professionals,

I have a dataset with 3 variables
hosp -- hospitalized for at least once (1,0)
sex  -- m,f
grp -- 1,2,3

How could I use the PROC TABULATE procedure to produce
a table like:

-----------------------------------------------------
                 m              f               total
         --------------   -------------------
         grp1 grp2 grp3   grp1 grp2 grp3
-----------------------------------------------------
hosp
  1
  0
-----------------------------------------------------
Inside the table is the number of people hospitalized.
Thanks so much.

Liyan

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
0
Reply liyanliu888 (12) 10/2/2003 11:22:56 PM


1 Replies
31 Views

(page loaded in 0.065 seconds)

Similiar Articles:











7/19/2012 9:28:48 PM


Reply: