Similar Threads:
1.Clearing work.GSEG window when working with GPLOT interactive
Dear SAS-L,
Does anyone know how to clear the work.GSEG window of plots from consecutive
plots (work.gseg.glpot[1..n]) when working with
SAS and running glpot interactively.
Thanks, any help is appreciated.
Jake
2.defaulte work library is not "work"
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* createdsns(id);
data work.&client._var_&id;
length Elig_id $*30*;
length rf_&id *8*;
output;
run;
*
%mend*;
*
proc* *datasets* lib=work kill;
*
run*;
/* move relative files from warehouse sever to work;
data work.&client._claims;
set extn.&client._&SvcMths._MTH_&period._CLAIM;
run;
data work.&client._elig;
set extn.&client._&SvcMths._MTH_&period._elig;
run;
data work.&client._pharm;
set extn.&client._&SvcMths._MTH_&period._pharm;
run;
*/
* move relative files from warehouse sever to work;
*
data* work.&client._claims (rename=(elig_id=claim_elig_id));
set orig.&client._CLAIMS;
*
run*;
*
data* work.&client._elig;
set orig.&client._elig;
*
run*;
*
data* work.&client._pharm (rename=(elig_id=pharm_elig_id));
set orig.&client._pharm;
*
run*;
*Get eligible meidcal claim;
*
proc* *sql* noprint;
create table work.claims as
select distinct cl.*
from work.&client._claims cl, work.&client._elig e
where cl.claim_elig_id=e.elig_id;
*
quit*;
*Get eligible pharm claims;
*
proc* *sql* noprint;
create table work.pharm as
select distinct ph.*
from work.&client._pharm ph, work.&client._elig e
where ph.pharm_elig_id=e.elig_id;
*
quit*;
* all elig member;
*
data* work.elig;
set work.&client._elig;
*
run*;
*Get all involved reps;
*
proc* *sql* noprint;
create table work.&client._RF as
select distinct elig_id
from work.abb_elig
quit;
*
proc* *sort* data=work.&client._RF;
by elig_id;
*
run*;
/*
proc sql noprint;
create table work.&client._RFall as
select distinct elig_id label="Elig_id"
from
(
select distinct elig_id
from orig.&client._elig
) as a;
quit;
*/
/* create dummy datasets*/
*
data* _null_;
set user.rfs_labels;
call execute('%createdsns('||strip(id)||');');
*
run*;
*
proc* *sql* noprint;
select count(*) into: numRF
from user.rfs_labels;
*
quit*;
/*Make a label stirng*/
/* Set up column of result table;
proc sql
proc sql noprint;
alter table work.&client._RF
add rf1 int;
quit;
*/
* trasform codeset maps;
*
proc* *sort* data=user.codesetmaps out=work.codesetmaps;
by id codetypecd;
*
run*;
*
Data* work.codesetmaps_mac_loookup (drop=codesetvalue) ;
Length ValueString $ *2000* ;
Set work.codesetmaps ;
By ID CodeTypeCD ;
Retain ValueString ;
ValueString = CatX( ',' , ValueString ,cats("'",CodeSetValue,"'")); ;
If Last.CodeTypeCD Then Do ;
Output ;
Call Missing( ValueString ) ;
End ;
*
run*;
/* Get a specific target dataset
data work.target;
set work.codesetmaps_mac_loookup;
where id=1;
run;*/
*
%Macro* calculateRFs(codetypecd, id, valueString);
%if &CodeTypeCd = *2* %then %do;
proc sql noprint;
select lowcase(strip(type)) into:idtype
from user.rfs_labels
where id=&id;
quit;
%if &idtype=binary %then %do;
proc sql noprint;
create table work.temp&id as
select distinct claim_elig_id as elig_id,
*1* as RF_&id
from work.claims
where claim_icd1_code in(&valueString) or
claim_icd2_code in(&valueString) or
claim_icd3_code in(&valueString);
quit;
%end;
%else %do;
proc sql noprint;
create table work.temp&id as
select claim_elig_id as elig_id,count(*) as RF_&id
from work.claims
where claim_icd1_code in(&valueString) or
claim_icd2_code in(&valueString) or
claim_icd3_code in(&valueString)
group by claim_elig_id;
quit;
%end;
%end;
%else %if &codetypecd=*3* %then %do;
proc sql noprint;
select lowcase(strip(type)) into:idtype
from user.rfs_labels
where id=&id;
quit;
%if &idtype=binary %then %do;
proc sql noprint;
create table work.temp&id as
select distinct pharm_elig_id as elig_id,
*1* as RF_&id
from work.pharm p
where p.pharm_ndc_code in
(
select ndc_code from sqlref.ref_ndc_mast
where ndc_thera_class_code in (&valueString)
);
quit;
%end;
%end;
proc append base=work.&client._var_&id data=work.temp&id;
run;
*
%mend*;
*
data* _null_;
set work.codesetmaps_mac_loookup;
/*call execute ('%calculateRFs('||codetypecd||','||id||',' ||
'%nrstr('||trim(valueString)|| '));');*/
call execute ('%nrstr(%calculateRFs('||codetypecd||','||id||', %nrstr('||
trim(valueString)|| ')));');
*
run*;
/* Marco for sorting*/
*
%Macro* sortalldsn();
%do i=*1* %to *415*;
%if %sysfunc(exist(&client._rf_&i)) %then %do;
proc sort data=&client._rf_&i;
by id;
run;
%end;
%end;
*
%mend*;
option mprint mlogic symbolgen;
%*sortalldsn*();
*proc* *print* data=sashelp.class;
*
run*;
*
proc* *sql* noprint;
select cats("&client._var_",id) into: allids SEPARATED BY ' '
from work.codesetmaps_mac_loookup;
*
run*;
*
data* &client._all_rfs;
merge &client._rf &allids;
by elig_id;
*
run*;
*
proc* *print* data=abb_rf;
*
run*;
3.I am getting ERROR : Unable to clear or re-assign the library
Hi all,
I am running my program in batch mode. I am calling user defined macro
twice in my code. I that macro i am assigning library ARDATA. Since i am
calling user defined macro twice in the same session i am this error for
library assignments.
First time when i am calling i have no problem. But when i call second
time i getting this error. Please any one can help me in this.
ERROR : Unable to clear or re-assign the library ARDATA because it is
still in use.
Cheers,
Suhas
4.The clear command does not work for graphs window
Hi there,
I need to clear all the figures in the graph window that I created. But the
clear command which ususally works well for the output window failed to do
so. Anyone has the idea of that?
Thanks!
gim
5.Clear Output, Clear Log, Find
6. library WORK may not be reassigned
7. Mainframe Interactive SAS expanded WORK library
8. mainframe work library space question