KM E 252 3 5subjs 1 332 1 14 %csg_subset_subjects_001(subjdsn=adam.adsl ,subjvar=usubjid ,subjmasking=%str() ,trtvar=trt01pn ,add_vars_from_subjdsn=trt01pn ,nsubjs=5 ,indsn=sdtm.mh ,indsnwhere=%str() ,outdsn=admh ,macid=subsubj_ ,randompick=Y ,debug=Y ); 44 1 252 3 ch1 17 253 1 251 1 47 251 1 42 251 1 60 251 1 104 251 1 49 251 1 62 287 1 255 1 287 1 251 1 60 251 1 47 251 1 104 251 1 49 251 1 62 251 1 42 251 1 47 12 0 252 3 ch2 17 253 1 251 1 47 251 1 42 251 1 60 251 1 104 251 1 50 251 1 62 287 1 255 1 287 1 251 1 60 251 1 47 251 1 104 251 1 50 251 1 62 251 1 42 251 1 47 11 0 252 3 ch3 21 253 1 251 1 47 251 1 42 251 1 60 251 1 104 251 1 51 251 1 62 287 1 255 1 287 1 251 1 47 251 1 42 280 1 280 1 251 1 60 251 1 47 251 1 104 251 1 51 251 1 62 251 1 42 251 1 47 14 0 252 3 cmi 1 332 1 1 %create_master_index(indsn=%str(root.master_metadata),indexloc=%str(&root.),runexport=N,runwebpage=N); 61 1 252 3 cmnt1 1 332 1 4 *==============================================================================; * ; *==============================================================================; 37 1 252 3 cmnt2 1 332 1 4 *------------------------------------------------------------------------------; * ; *------------------------------------------------------------------------------; 38 1 252 3 cmnt3 1 332 1 4 %*=============================================================================; %* ; %*=============================================================================; 39 1 252 3 cmnt4 1 332 1 4 %*-----------------------------------------------------------------------------; %* ; %*-----------------------------------------------------------------------------; 40 1 252 3 countcheck 1 332 1 67 %macro countcheck(dsn1=, dsn2=, byvar=); data _left; set &dsn1; run; data _right; set &dsn2; run; %local tablevar; %let byvar=%sysfunc(compbl(&byvar.)); %let tablevar =%sysfunc(tranwrd(&byvar.,%str( ),%str(*))); proc freq data= _left noprint ; tables &tablevar. /list missing out=_uniquevalues01; where 1=1; run; proc freq data= _right noprint; tables &tablevar. /list missing out=_uniquevalues02; where 1=1; run; data full both aonly bonly; merge _uniquevalues01(in=a drop=percent rename=(count=counta)) _uniquevalues02(in=b drop=percent rename=(count=countb)); by &byvar.; if counta ne countb then cmiss=1; if a and b then both=1; if a and not b then aonly=1; if b and not a then bonly=1; if a or b then output full; if a and b then output both; if a and not b then output aonly; if b and not a then output bonly; run; proc sort data=_left out=_left_sort; by &byvar.; run; data check_a; merge _left_sort(in=a) full(in=b); by &byvar.; if a; run; proc sort data=_right out=_right_sort; by &byvar.; run; data check_b; merge _right_sort(in=a) full(in=b); by &byvar.; if a; run; %mend countcheck; %countcheck(dsn1= , dsn2= , byvar= ); 4 1 g 252 3 cput 10 254 1 253 1 251 1 112 251 1 117 251 1 116 251 1 32 251 1 39 255 1 251 1 39 251 1 59 9 0 . 252 3 csg_mult 1 332 1 108 %*=============================================================================; %*Sort multiple datasets with same by variables; %*=============================================================================; %macro multsort(dsnlist=%str( ),byvars=%str( ),where=%str()); %local _dsncount _dsni _currentdsn; %let _dsncount=%sysfunc(countw(&dsnlist,%str( ))); %do _dsni=1 %to &_dsncount.; %let _currentdsn=%scan(&dsnlist.,&_dsni,%str( )); proc sort data= &_currentdsn. out=%scan(&_currentdsn.,-1,%str(.))_out; by &byvars.; where &where.; run; %end; %mend multsort; %*=============================================================================; %*Removing duplicates based on same by variables from multiple datasets; %*=============================================================================; %macro multdup(dsnlist=%str( ),byvars=%str( ),where=%str()); %local _dsncount _dsni _currentdsn; %let _dsncount=%sysfunc(countw(&dsnlist,%str( ))); %do _dsni=1 %to &_dsncount.; %let _currentdsn=%scan(&dsnlist.,&_dsni,%str( )); proc sort data= &_currentdsn. out=%scan(&_currentdsn.,-1,%str(.))_firstocc dupout=%scan(&_currentdsn.,-1,%str(.))_subsqoccs nodupkey; by &byvars.; where &where.; run; %end; %mend multdup; %*=============================================================================; %*Checking for the unique and non-unique records based on same by variables in multiple dataset; %*=============================================================================; %macro multuniq(dsnlist=%str( ),byvars=%str( ),where=%str()); %local _dsncount _dsni _currentdsn; %let _dsncount=%sysfunc(countw(&dsnlist,%str( ))); %do _dsni=1 %to &_dsncount.; %let _currentdsn=%scan(&dsnlist.,&_dsni,%str( )); proc sort data= &_currentdsn. out=%scan(&_currentdsn.,-1,%str(.))_nonuniq uniqueout=%scan(&_currentdsn.,-1,%str(.))_uniq nouniquekeys; by &byvars.; where &where.; run; %end; %mend multuniq; %*=============================================================================; %*Checking for the unique and non-unique records based on same by variables in multiple dataset; %*=============================================================================; %macro multfreq(dsnlist=%str( ),tables=%str( ),where=%str()); %local _dsncount _dsni _tablesi _tablescount _currentdsn _currentable; %let _dsncount=%sysfunc(countw(&dsnlist,%str( ))); %let _tablescount=%sysfunc(countw(&tables,%str( ))); %do _dsni=1 %to &_dsncount.; %let _currentdsn=%scan(&dsnlist.,&_dsni,%str( )); proc freq data= &_currentdsn ; %do _tablesi=1 %to &_tablescount.; %let _currenttable=%scan(&tables.,&_tablesi,%str( )); tables &_currenttable. /list missing out=%scan(&_currentdsn.,-1,%str(.))_freq0&_tablesi.; %end; where 1=1; run; %end; %mend multfreq; %macro multsqlf(dsnlist=%str( ),filterdsn=,innotin=%str(in),catsvars=%str(usubjid),selectvars=%str(*),outerwhere=%str(1=1),innerwhere=%str(1=1)); %local _dsncount _dsni _currentdsn; %let _dsncount=%sysfunc(countw(&dsnlist,%str( ))); %do _dsni=1 %to &_dsncount.; %let _currentdsn=%scan(&dsnlist.,&_dsni,%str( )); proc sql; create table %scan(&_currentdsn.,-1,%str(.))_sqlf as select &selectvars. from &_currentdsn. where cats(&catsvars.) &innotin. (select distinct cats(&catsvars.) from &filterdsn. where &innerwhere. ) and &outerwhere.; quit; %end; %mend multsqlf; 63 1 252 3 cta copy as html table 28 253 1 251 1 47 251 1 42 251 1 60 251 1 116 251 1 97 251 1 98 251 1 108 251 1 101 251 1 63 280 1 251 1 62 287 1 255 1 251 1 60 251 1 47 251 1 116 251 1 97 251 1 98 251 1 108 251 1 101 251 1 63 280 1 251 1 47 280 1 251 1 62 251 1 42 251 1 47 28 0 252 3 ctd add html table data 18 253 1 251 1 44 280 1 251 1 60 251 1 116 251 1 100 251 1 62 287 1 251 1 60 280 1 255 1 287 1 251 1 60 251 1 47 251 1 116 251 1 100 251 1 62 287 1 34 0 252 3 ctext 29 253 1 251 1 42 251 1 60 251 1 116 251 1 101 251 1 120 251 1 116 251 1 97 251 1 114 251 1 101 251 1 97 251 1 62 251 1 59 287 1 255 1 287 1 251 1 42 251 1 60 251 1 47 251 1 116 251 1 101 251 1 120 251 1 116 251 1 97 251 1 114 251 1 101 251 1 97 251 1 62 251 1 59 10 0 252 3 cth add html table header 14 253 1 251 1 60 251 1 116 251 1 104 251 1 62 287 1 255 1 287 1 251 1 60 251 1 47 251 1 116 251 1 104 251 1 62 287 1 29 0 252 3 ctr add html table row 14 253 1 251 1 60 251 1 116 251 1 114 251 1 62 287 1 255 1 287 1 251 1 60 251 1 47 251 1 116 251 1 114 251 1 62 287 1 35 0 I 252 3 dhf 1 332 1 1 %datasets_html_for_sascncpts(datasets=%str()); 62 1 g 252 3 dqp 10 254 1 253 1 251 1 112 251 1 117 251 1 116 251 1 32 251 1 34 255 1 251 1 34 251 1 59 27 0 = 252 3 header 1 332 1 31 %******************************************************************** **; %** Project : Sample Drug, Sample Indication,Study1 **; %** Program name : sample.sas **; %** Author : CKID9 **; %** Date created : 2018-07-08 **; %** Purpose : This is the purpose of the program. **; %** **; %** **; %******************************************************************** **; %** Addtional details : **; %******************************************************************** **; %** Data source: **; %** Documentation source: **; %** Etc: **; %** **; %******************************************************************** **; %** Revision History : **; %******************************************************************** **; %** **; %**----------------------------------------------------------------------------------- **; %** Revision number : **; %** Author/Date : **; %** Modification : **; %** Reason : **; %** Version signature: Eg: [001: CKID9/1Jan1960] **; %**----------------------------------------------------------------------------------- **; %** **; %** **; %******************************************************************** **; 0 1 252 3 htinsert 1 332 1 17 /*
*/ 20 1 0 252 3 htmlpre 1 332 1 3 *
; *; 17 1 2 252 3 htmlsp 1 332 1 1      43 1 3 252 3 htmlta 1 332 1 3 /*