Mainframe Interactive SAS expanded WORK library

sas

    Next

  • 1. Can proc sql read raw data from a big text file?
    Because I have a SQL codes provided for SQL server to read such data. I couldn't find any example that proc sql can read raw data from a file. Thank you for your answer. Andrew
  • 2. Is there a PROC procedure to check the distribution of data?
    Hi SAS users, I was wondering if there is a PROC procedure to check the distribution of data? Such as goodness-of-fit test? Any suggestion is highly appreciated! Serena
  • 3. easy way to strip formats & create new vars with formatted values?
    Hi, folks. Does anyone know an easy way to strip all formats in a dataset and display formatted values as new values using the same vars (maybe changes type char or num where necessary) Thanks Igor Kurbeko Clinical Programmer Analyst 678 336 4328 XXXX@XXXXX.COM Imagination is more important than knowledge
  • 4. Print datasets by batch with macro
    Hello All, I want to print datasets together with macro. The names of these dataset are "IL011", "IL012", "IL023", "IL031". And titles I want to put are different. So I made an "index" dataset like. ID Title 011 Check one: a>b 012 Check two: c<d 023 Check three: e>f 031 Check four: k<t I'd like that the resolved program looks like proc print data=IL011; title "Check one: a>b"; proc print data=IL012; title "Check two: c<d"; proc print data=IL023; title "Check three: e>f"; proc print data=IL031; title "Check four: k<t"; How can I make it? Thanks, Deng Yue

Mainframe Interactive SAS expanded WORK library

Postby abe_anon » Sat, 22 May 2004 07:54:07 GMT

Can one invoke interactive SAS on the mainframe with a larger WORK lib than
ordinary? In batch mode I can code my EXEC statement: //SASTEP EXEC
SASPROD,WORK='1000,100' (instead of just //SASTEP EXEC SASPROD) to do this.
How can I do it when i invoke interactive SAS from TSO (by entering the
command SASPROD) ?

Thank You!
Abe

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page FREE
download!  http://www.**--****.com/ 

Re: Mainframe Interactive SAS expanded WORK library

Postby sashole » Sat, 22 May 2004 12:57:51 GMT

Abe,

You can override the default size at invocation (see the Companion for the
exact syntax when executing the SAS CLIST). That would be, off the top of my
now MVS-rusty head,

SASPROD WORK('1000 100')

Alternatively (and perhaps much better), create your own CLIST pointing to
your own config whence you can control any system option you fancy. By the
way, pay attention to the default block size of SAS data sets specified in
the default system config. Often times, it is the unfathomable 6144 (and
with RECFM=FS, so is LRECL=6144), while for 3390 DASD 27648 is the optimum,
and as a result, the machine wastes I/O cycles, CPU, and elapsed time. If
you cannot amend your CLIST, create your own config file and then override
the default config at invocation along the lines of

SASPROD CONFIG('''os FILE NAME''')

Kind regards,
Hash-Man


Re: Mainframe Interactive SAS expanded WORK library

Postby mark.mdme » Sat, 22 May 2004 23:38:39 GMT

Abe,

If you are using large temporary datasets, you might be able to create a
"user"
library with a libname statement (Version 8 code):

 LIBNAME  USER     "system.supported.name"
                   DISP=(NEW,DELETE,DELETE)

                   DATACLAS=SASLIB

                   SPACE=(CYL,(2500,2500),RLSE)

                   ;



Modifying to fit your system's parameters, size limits, etc.


If present, SAS writes all temporary datasets created by YOU into the
USER library instead of the WORK library.

You could also name the library something else (say "MYLIB") and use the
statement:

OPTIONS
   USER=MYLIB
   ;

To put your data there.

If your issue is sorting space and other system created files, then this
will not help (and I'm
not proficient enough to tell you what to do in interactive SAS).

Mark Mattson
(919) 933-9816


=======================================================

From: Abe Anon < XXXX@XXXXX.COM >
Date: Thu, 20 May 2004 15:54:07 -0700
Subject: Mainframe Interactive SAS expanded WORK library

Can one invoke interactive SAS on the mainframe with a larger WORK lib
than
ordinary? In batch mode I can code my EXEC statement: //SASTEP EXEC
SASPROD,WORK='1000,100' (instead of just //SASTEP EXEC SASPROD) to do
this.
How can I do it when i invoke interactive SAS from TSO (by entering the
command SASPROD) ?

Thank You!
Abe

Similar Threads:

1.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.

2.Cannot Allocate a SAS Library in Interactive SAS(TSO)

Hello,

I am trying to allocate a SAS dataset in interactive SAS on a Z/OS
mainframe.  I can view the dataset if I run a batch job however I get
the following error when running interactive SAS.

ERROR: SVC99 error rc=4, reason=0218 : IKJ56221I DATA SET XXXXXXXXXXXX
   NOT ALLOCATED, VOLUME NOT  AVAILABLE+IKJ56221I VOLUME  NECESSARY TO
SATISFY YOUR REQUEST NOT ON SYSTEM, AND CANNOT BE MOUNTED

The dataset is on catridge, is this the reason why I cannot mount it
interactively and is there a way to overide this ?

Thanks


3.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

4.proc printto print="filename" not working in interactive sas

I use sas in batch exclusively but I have to make sure interactive
users can use my macros. One of these macros redirects print output
using "proc printto print='filename'". This works in batch but when I
run it interactively, instead of sending the print output to the file
I specified, it still uses the output window. How do I get this to
work correctly in interactive sas?

5.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*;

6. RE : access sas/connect's work library through sas/share's JDBC

7. Meaning of SAS UNIX work library hex string

8. SAS Oracle Update with work library



Return to sas

 

Who is online

Users browsing this forum: No registered users and 19 guest