<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: dataset not getting created in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/dataset-not-getting-created/m-p/614613#M18612</link>
    <description>&lt;P&gt;When you use ODS SELECT NONE you create NO ods output objects.&lt;/P&gt;
&lt;P&gt;So the ODS output has nothing to output from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, why do you have ODS Select NONE just before the ODS Output???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you only want the LSMEANS then use ODS Select Lsmeans; (or perhaps Mixed.means, may have to turn ods trace on to get the correct full name)&lt;/P&gt;</description>
    <pubDate>Tue, 31 Dec 2019 18:51:52 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-12-31T18:51:52Z</dc:date>
    <item>
      <title>dataset not getting created</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dataset-not-getting-created/m-p/614450#M18590</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname raw "/folders/myfolders/cliniops/REN002/tables" ;

%let outpath=/folders/myfolders/cliniops/REN002/tables ;
%let pgmname=t14_2_1 ;

* options byline ;
%let tst=* ;


proc format;
	value visf -1='Screening'
				0='Baseline'
				2='02 hrs'
				4='04 hrs'
				8='08 hrs'
				12='12 hrs'
				18='18 hrs'
				24='24 hrs'
				48='48 hrs'
				72='72 hrs'
				96='96 hrs'
				168='168 hrs' ;
	value sumf	1='Visit Value'
				2='Change'
				3='% Change' ;
	value $stf 'NV'='N'
			   'MV'='Mean'
			   'SV'='SD'
			   'DV'='Median'
			   'IV'='Min'
			   'AV'='Max' ;
	value $st2f 'NV'='N'
			    'MV'='GeoMean[1]'
			    'SV'='GeoCV%[2]'
			    'DV'='Median'
			    'IV'='Min'
			    'AV'='Max' ;
run ;

proc import datafile = '/folders/myfolders/cliniops/excel data files/programs/subset1.csv'
out = raw.renibus
dbms = csv
replace;
run;

/*data cm ;
	length SUBJECT $8 ;
	set renibus ;
	if CMTRT__CMD__CM__logs^='' ;
	subject=put(subject_id,z3.) ;
	rename 	CMDOCYN__CMD__CM__logs=CMDOCYN
			CMDOSFRM__CMD__CM__logs=CMDOSFRM
			CMDOSFRQ__CMD__CM__logs=CMDOSFRQ
			CMENDAT__CMD__CM__logs=CMENDAT
			CMINDC__CMD__CM__logs=CMINDC
			CMONGO__CMD__CM__logs=CMONGO
			CMPRIOR__CMD__CM__logs=CMPRIOR
			CMROUTE__CMD__CM__logs=CMROUTE
			CMSTDAT__CMD__CM__logs=CMSTDAT
			CMTRT__CMD__CM__logs=CMTRT ;
	keep subject CMDOCYN__CMD__CM__logs CMDOSFRM__CMD__CM__logs CMDOSFRQ__CMD__CM__logs CMENDAT__CMD__CM__logs CMINDC__CMD__CM__logs
		 CMONGO__CMD__CM__logs CMPRIOR__CMD__CM__logs CMROUTE__CMD__CM__logs CMSTDAT__CMD__CM__logs CMTRT__CMD__CM__logs ;
run ;*/


PROC IMPORT OUT= raw.lab 
            DATAFILE= "/folders/myfolders/cliniops/excel data files/programs/CliniOps-Renibus-Lab-REN-002-Jan-16-2019-1.xlsx" 
            DBMS=xlsx REPLACE;
RUN;


data adsl ;
	length SUBJECT STRATUM $8 ;
	set raw.renibus ;
	if I_SCNNO__HEADER__CKDIE__ScrVST not in ('.','') then stratum='CKD' ;
	if I_SCNNO__HEADER__HVIE__ScrVst  not in ('.','') then stratum='HV' ;
	if stratum='' then delete ;
	subject=put(subject_id,z3.) ;
	COHORT=strip(COHORT__COHORT__ALSUBJSCN_ScrVst) ;
	TYPE=strip(INIE_COHORT_ALSUBJSCN_Screen);	 *1=HV, 2=CKD ;
	keep subject stratum cohort type ;
run ;

data lb ;
	length SUBJECT TESTCD $8  VISIT $24 ;
	set raw.lab ;
	subject=substr(subject_id,2,3) ;
	if test in ('Ferritin','Haptoglobin','Plasma HO-1','Plasma Hemopexin','Plasma P21') ;* 'INTERLEUKIN10' ;
	if      test='Ferritin'         then testcd='FE' ;
	else if test='Haptoglobin'      then testcd='HPG' ;
	else if test='INTERLEUKIN10'    then testcd='IL10' ;
	else if test='Plasma HO-1'      then testcd='PHO1' ;
	else if test='Plasma Hemopexin' then testcd='PHPX' ;
	else if test='Plasma P21'       then testcd='PP21' ;
	if index(visit,'Screening')&amp;gt;0 then visit='Screening Visit' ;
	if visit='Study Day 1-2HR' then visit='Study Day 1, 02HR' ;
	if visit='Study Day 1-4HR' then visit='Study Day 1, 04HR' ;
	if visit='Study Day 1-8HR' then visit='Study Day 1, 08HR' ;
	if visit='Study Day 1-12HR' then visit='Study Day 1, 12HR' ;
	if visit='Study Day 1-18HR' then visit='Study Day 1, 18HR' ;
	if visit='Study Day 1-Basel' then visit='Study Day 1' ;
	if visit='Study Day 2-Basel' then visit='Study Day 2' ;
	if visit='Study Day 3-Basel' then visit='Study Day 3' ;
	if visit='Study Day 4-Basel' then visit='Study Day 4' ;
	if visit='Study Day 5-Basel' then visit='Study Day 5' ;
	if index(visit,'Screening')&amp;gt;0 then VISITN=-1 ;
	if index(visit,'02HR')&amp;gt;0 then visitn=2 ;
	if index(visit,'04HR')&amp;gt;0 then visitn=4 ;
	if index(visit,'08HR')&amp;gt;0 then visitn=8 ;
	if index(visit,'12HR')&amp;gt;0 then visitn=12 ;
	if index(visit,'18HR')&amp;gt;0 then visitn=18 ;
	if visit='Study Day 1' then visitn=0 ;
	if visit='Study Day 2' then visitn=24 ;
	if visit='Study Day 3' then visitn=48 ;
	if visit='Study Day 4' then visitn=72 ;
	if visit='Study Day 5' then visitn=96 ;
	if visit='Study Day 8' then visitn=168 ;
	if value not in ('-','Plasma','Sample') then aval=input(value,best.) ;
	format visit $char24. ;
run ;

proc sort data=lb ;
	by subject testcd visitn ;
run ;

proc sort data=adsl ;
	by subject ;
run ;

data lb2 ;
	merge lb adsl ;
	by subject ;
	if testcd in ('FE','HPG','PHPX','PP21') ;
run ;

data base ;
	set lb2 ;
	where visitn=0 ;
	rename aval=base ;
	keep subject testcd aval ;
run ;

data lb3 ;
	merge lb2(in=a where=(visitn&amp;gt;=0)) base(in=b) ;
	by subject testcd ;
	if a and b ;
/*	if visitn&amp;gt;0 and aval&amp;gt;. then do ;*/
/*		CHG=aval-base ;*/
/*		PCHG=(aval-base)/base*100 ;*/
/*	end ;*/
	LOGBASE=log(base) ;
	if aval&amp;gt;. then do ;
		LOGAVAL=log(aval) ;
		if visitn&amp;gt;0 then do ;
			CHG=aval-base ;
			CHGLOG=logaval-logbase ;
			PCHG=(aval-base)/base*100 ;
		end ;
	end ;
	output ;
	stratum='HV+CKD' ;
	output ;
run ;

/*
data lb3tmp ;
	set lb3 ;
	logaval=log(aval) ;
run ;

proc sort data=lb3tmp ;
	by test ;
run ;

ods select histogram qqplot testsfornormality ;
proc univariate data=lb3tmp normal ;
	var pchg ;* aval logaval ;
	histogram ;
	qqplot ;
	by test ;
run ;
* USE LOG(FERRITIN), LOG(HAPTOGLOBIN) OR BAPTOGLOBIN, HO-1, LOG(PLASMA HEMOPEXIN), LOG(PLASMA P21) ;
*/

proc sort data=lb3 ;
	WHERE STRATUM='HV' AND TESTCD='FE' ;	
	by stratum testcd visitn cohort ;
run ;

proc summary data=lb3 ;
	var logaval ;
	by stratum testcd test visitn cohort ;
	output out=visval n=nv mean=mv std=sv median=dv min=iv max=av cv=cv ; 
run ;

proc summary data=lb3 ;
	where visitn&amp;gt;0 ;
	var chglog ;
	by stratum testcd test visitn cohort ;
	output out=chg n=nv mean=mv std=sv median=dv min=iv max=av cv=cv ; 
run ;

proc summary data=lb3 ;
	where visitn&amp;gt;0 ;
	var pchg ;
	by stratum testcd test visitn cohort ;
	output out=pchg n=nv mean=mv std=sv median=dv min=iv max=av ; 
run ;

data summ ;
	set visval(in=a) chg(in=b) pchg(in=c) ;
	by stratum testcd visitn cohort ;
	if a then sumtyp=1 ;
	if b then sumtyp=2 ;
	if c then sumtyp=3 ;
	if a or b then do ;
		mv=exp(mv) ;	* CONVERT FROM LOG BACK TO ORIGINAL SCALE, THIS IS GEOMETRIC MEAN ;
		sv=sqrt(exp(sv**2)-1)*100 ;* exp(sv) ;* COEFFICIENT OF VARIATION FOR GEOMETRIC MEAN ;
		dv=exp(dv) ;	* MEDIAN, MIN, MAX BACK TO ORIGINAL SCALE ;
		iv=exp(iv) ;
		av=exp(av) ;
	end ;
run ;

proc sort data=summ ;
	by stratum testcd visitn sumtyp cohort ;
run ;

proc transpose data=summ out=summ2 ;
	var nv mv sv dv iv av ;
	by stratum testcd test visitn ;
	id cohort sumtyp ;
run ;

data summ3 ;
	set summ2 ;
	by stratum testcd test visitn ;
	length STAT $44 ;
	stat=put(_name_,$stf.) ;
	array old cohort_11 cohort_12 cohort_13 cohort_21 cohort_22 cohort_23 cohort_31 cohort_32 cohort_33 ;
	array new $20 c11 c12 c13 c21 c22 c23 c31 c32 c33 ;
	do over old ;
		if _name_='NV' then new=put(old,2.) ;
		if _name_ in ('MV','DV') then new=put(old,8.3) ;
		if _name_='SV' then new=put(old,8.4) ;
		if _name_ in ('IV','AV') then new=put(old,8.2) ;
		new=strip(new) ;
		if new='.' then new='' ;
	end ;
run ;

ods select none ;
ods output lsmeans=lsm_aval ;
proc mixed data=lb3 ;
	where visit^='Study Day 1' ;
	by stratum testcd test ;
	class cohort visitn subject ;
	model logaval = cohort visitn cohort*visitn logbase / ddfm=kr2 ;
	repeated visitn / subject=subject type=cs ;* ar(1) ;
	lsmeans cohort*visitn / slice=visitn cl ;
run ;
ods select all ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;i am getting error work.lsm_aval does not exsist, though my code has&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;CODE class=" language-sas"&gt;ods output lsmeans=lsm_aval ;&amp;nbsp; &amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;why the dataset lsm_aval is not getting created?&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 20:03:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dataset-not-getting-created/m-p/614450#M18590</guid>
      <dc:creator>TANMOY05</dc:creator>
      <dc:date>2019-12-30T20:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: dataset not getting created</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dataset-not-getting-created/m-p/614456#M18592</link>
      <description>&lt;P&gt;Work through the log, from top down, and eliminate all ERRORs and WARNINGs.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 20:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dataset-not-getting-created/m-p/614456#M18592</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-30T20:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: dataset not getting created</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dataset-not-getting-created/m-p/614511#M18610</link>
      <description>Yeah , i am getting that error only as the first error in my log file , i.e&lt;BR /&gt;Couldn't find work.lsm_aval&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Dec 2019 04:11:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dataset-not-getting-created/m-p/614511#M18610</guid>
      <dc:creator>TANMOY05</dc:creator>
      <dc:date>2019-12-31T04:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: dataset not getting created</title>
      <link>https://communities.sas.com/t5/New-SAS-User/dataset-not-getting-created/m-p/614613#M18612</link>
      <description>&lt;P&gt;When you use ODS SELECT NONE you create NO ods output objects.&lt;/P&gt;
&lt;P&gt;So the ODS output has nothing to output from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, why do you have ODS Select NONE just before the ODS Output???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you only want the LSMEANS then use ODS Select Lsmeans; (or perhaps Mixed.means, may have to turn ods trace on to get the correct full name)&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2019 18:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/dataset-not-getting-created/m-p/614613#M18612</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-31T18:51:52Z</dc:date>
    </item>
  </channel>
</rss>

