defaulte work library is not "work"

sas

    Next

  • 1. Cannot use 'CON' as dataset name
    SAS-Lers, Does anyone know why 'CON' cannot be used as a dataset name on PC? Why does MS reserve it? Just curious. Frank Mwaniki
  • 2. having problem to read 2008 year?????
    options yearcutoff= 1920; data hosp ; input @1 ID 2. @5 ADMIT MMDDYY8. @19 DISCHRG MMDDYY8. @30 COST dollar8.; format admit dischrg mmddyy10. cost dollar8.; datalines; 78 03/23/2008 03/27/2008 12345 68 03/21/2008 03/24/2008 22345 98 04/23/2008 04/27/2008 42345 75 05/23/2008 05/27/2008 52345 56 03/02/2008 03/17/2008 62345 90 02/23/2008 02/27/2008 82345 45 04/23/2008 04/26/2008 72345 53 01/23/2008 01/27/2008 92345 67 03/23/2008 03/28/2008 11345 ; run; But when I run this program, instead of 03/23/2008, I am getting 03/23/2002 Can somebody explain why, and give me the solution. Any help or suggestion is appreciated.

defaulte work library is not "work"

Postby zhujp98 » Thu, 05 Mar 2009 05:15:33 GMT

After running following code, the defaulted work directory changed to
"user".
how can I change back it to "work" again?
Thanks.
Jeff



OPTIONS NONOTES NOSOURCE NOSOURCE2;

*option mprint mlogic symbolgen;

%let dir=M:\Users\JP\PM\PM_RF;

%let datasetdir=M:\Users\JP\PM\Participation Study;

%let testids=51,52,53;

%let client = ABB;

%let Period=RF;

%let SvcMths=2;

libname orig "&datasetdir.\datasets";

libname user "&dir.\userInputs";

*libname ret 'N:\PM\Participation Study\Results';

*libname extn odbc uid=&SYSUSERID dsn=mhcdatawh_dev schema=dbo
readbuff=5000;
*

proc* *datasets* lib=user kill;
*

run*;
*

proc* *datasets* lib=work kill;
*

run*;

/*Open definition file*/

options noxwait noxsync;

x '"C:\Program Files\Microsoft Office\Office12\excel.exe"';
*

data* _null_;

x=sleep(*5*);
*

run*;

*;

/* open Excel workbook */

/*"N:\PM\PM_RF\CSVs\definitionT.csv" */

*;

filename ddecmd dde 'excel|system';
*

data* _null_;

file ddecmd;

put "[FILE-OPEN(""&dir.\CSVs\definition.xls"")]";
*

run*;

*;

/* specify desired Excel worksheet cell range */

*;

filename xlin DDE "excel|&dir.\CSVs\[definition.xls]definition!r2c1:r500c3";
*

run*;

*;

/* read Excel files using DDE into SAS data set*/

*;
*

data* user.rfs_labels_all;

infile xlin dlm='09'x notab missover dsd;

informat id *8.* type $20. label $200.;

input id type label;

format id *8.* type $8. label $200.;
*

run*;

*;

/* close Excel workbook and close Excel */
*

data* _null_;

file ddecmd;

put "[FILE-CLOSE(""&dir.\CSVs\definition.xls"")]";

put '[QUIT()]';
*

run*;

/*********************************************

*********************************************

*********************************************/

/*Open codesetmap excel file*/

x '"C:\Program Files\Microsoft Office\Office12\excel.exe"';
*

data* _null_;

x=sleep(*5*);
*

run*;

*;

/* open Excel workbook */

/*"N:\PM\PM_RF\CSVs\definitionT.csv" */

*;



filename ddecmd dde 'excel|system';
*

data* _null_;

file ddecmd;

put "[FILE-OPEN(""&dir.\CSVs\codemap.xls"")]";
*

run*;

*;

/* specify desired Excel worksheet cell range */

*;

filename xlin DDE "excel|&dir.\CSVs\[codemap.xls]codemap!r2c1:r3000c4";
*

run*;

*;

/* read Excel files using DDE into SAS data set*/

*;
*

data* user.codesetmaps_all;

infile xlin dlm='09'x notab missover dsd;

informat id *8.* codesetvalue $20. codeid *8.* codetypecd *8.*;

input id codesetvalue codeid codetypecd;

format id *8.* codesetvalue $20. codeid *8.* codetypecd *8.* ;
*

run*;

*;

/* close Excel workbook and close Excel */
*

data* _null_;

file ddecmd;

put "[FILE-CLOSE(""&dir.\CSVs\codemap.xls"")]";

put '[QUIT()]';
*

run*;

/*For program test and debug*/








*

data* user.rfs_labels (where=(id in (&testids.))); *(where=(id^=.));*;

set user.rfs_labels_all;
*

run*;
*

data* user.codesetmaps (where=(id in (&testids.)));* (where=(id^=.));*;

set user.codesetmaps_all;
*

run*;



/*

proc import out=user.ClaimHitsDriver

datafile = "N:\HI_Analytics\Projects\NCQA_DM_Test\NCQA
Codes\HEDISHitsDriver.txt"

dbms=tab replace; getnames=yes;

run;

proc sql;

create table work.HitsDriver as

select distinct CodeTypeCd, ColumnName1, ColumnName2, ColumnName3

from user.ClaimHitsDriver;

quit;

*/
*

%macro*

Re: defaulte work library is not "work"

Postby anindya.lugbang » Thu, 05 Mar 2009 13:19:14 GMT



It looks the library reference USER is being assigned in the code.
Please read the section which I have pasted from the link

 http://www.**--****.com/ 

Relation to the USER Library

While the WORK library is designed to hold temporary files used during
the current SAS session, the USER library is designed to hold files
after the SAS session is over. If you associate the libref USER with a
SAS data library, use a one-level name to create and access files that
are not deleted at the end of your SAS session. When SAS encounters a
one-level filename, it looks first in the USER library, if it has been
defined, and then it looks in WORK. If you wish to place a file in the
USER library, so that it is not deleted after your SAS session is
over, any single-level file goes there by default. At that point, if
you want to create a temporary file in WORK, you must use a two-level
name, such as WORK.name.

Regards,
Anindya

Similar Threads:

1.library WORK may not be reassigned

Sometimes I direct SAS to use a specified library as work library. But
now
    libname work '...my physical path...';
generated an Error report which says,

ERROR: The SAS system library WORK may not be reassigned.

I tried de-assinging work lib by
   libname work;
and immediately after that, reassign it, still using
    libname work '...my physical path...';
But it does not help.

How can I resolve this problem, without closing SAS and re-launch it ?

Thanks,

Tom

2.Mainframe Interactive SAS expanded WORK library

3.mainframe work library space question

I see there is a "work=30000" in mainframe JCL as,

//          EXEC SCSAS,WORK=30000


Here are my questions,

1) How much space is this WORK=30000 for a working library in mbtyes?

2) How to check the maximum working space one can allocate?

Thanks.

4.Work Library

How to make sure that work library is allocated maximum space ? Any
proc out there to know the status?

thanks N regards,
Raj.

5.Work Library Files for a Macro System

Hello SAS-L,

I am developing / have developed a set of macros, aka "macro system".
Most of the macros use the WORK library as the primary location to create
temp datasets which are then deleted at the conclusion of the macro.  But
one thing that tends to cause a problem with macros is how you name the
temporary datasets written to the work library.  You might over-write
other files that already exist in the work library.  Or, if you need to
recursively call a macro, at each recursion you may be over-writing the
dataset from the last recursion.

I have some ideas about how to solve this problem:
[1] Name all the temp datasets with a prefix according to the name of the
macro
[2] Add a timestamp (date+time) integer to the dataset name
[3] Put error checking logic into the macro so that it only runs if the
datasets which it will create do not already exist
[4] Need more ideas...

Essentially, all files written to the work library are "Global" in scope
for a SAS session and I need to prevent conflicts between them.  I would
like to create "Local" scope datasets for each time a macro is invoked.

Any suggestions???  For anyone who has developed macro systems, how have
you handled temp dataset naming conventions to increase the reliability of
the system?

- Paul

6. Reassigning Work Library in V9.1.3 ??

7. How to dynamically switch the directory of the "WORK" library

8. system options to preserve files in the WORK library



Return to sas

 

Who is online

Users browsing this forum: No registered users and 90 guest