BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tmm
Fluorite | Level 6 tmm
Fluorite | Level 6


I have some code which I will post on here and sometimes I get an error when running it, then other times I don't. If I run the proc sql alone and then the data step alone, I get the error. If I run them together it will work sometimes. If I start off running them together it will error so I then revert to separate and it works. I have multiple data steps that have a point = and once I get the first to run, the others that remain never error. It is just the first time I open my program this happens. Not sure why. The error is:

 

ERROR: The POINT= data set option is not valid for the data set CARDIAC.TINRESTUDY, the data set

must be accessible by observation number for POINT= processing.

My code:

PROC SQL;*restudy tin;

CREATE TABLE cardiac.tinrestudy AS

(SELECT DISTINCT mbr_sys_id, fst_srvc_dt, prov_tin, prov_tin_pci, prov_tin_cath, prov_tin_ct,

prov_tin_secho, prov_tin_tee, prov_tin_tte, prov_tin_perf, prov_tin_pet, prov_tin_cabg,

office_clinic, inpatient_facility, outpatient_facility,

prov_tin_maj_restudy, prov_tin_min_restudy, prov_tin_fu_30, prov_tin_fu_182

FROM cardiac.final11b

WHERE MBR_SYS_ID IN

(SELECT DISTINCT MBR_SYS_ID FROM cardiac.final11b

where nat_pci>. and

fst_srvc_dt>. )

and fst_srvc_dt >. and prov_tin > ('000000000'));

run;

options  compress=NO reuse=yes;

data cardiac.tinmaj;*maj restudies;

set cardiac.tinrestudy nobs=last_obs;

by mbr_sys_id ;

if prov_tin_pci=1  then do;

wb = fst_srvc_dt + 1;

we = fst_srvc_dt + 90;

do pt = _N_ + 1 to last_obs;

set cardiac.tinrestudy(keep= mbr_sys_id fst_srvc_dt prov_tin_ct prov_tin_cath

prov_tin_pet prov_tin_perf office_clinic inpatient_facility outpatient_facility

rename=(mbr_sys_id=mem fst_srvc_dt=dt prov_tin_ct = nct prov_tin_cath = ncath 

prov_tin_pet=pet prov_tin_perf=nperf office_clinic=ofc

inpatient_facility=ip outpatient_facility=op))

point=pt;

if mbr_sys_id ne mem or dt > we then leave;

if dt >= wb and dt<=we and ofc=1 and ncath=1 then ofc_majcath = sum(ofc_majcath,ncath);

if dt >= wb and dt<=we and ip=1 and ncath=1 then ip_majcath= sum(ip_majcath,ncath);

if dt >= wb and dt<=we and op=1 and ncath=1 then op_majcath= sum(op_majcath,ncath);

if dt >= wb and dt<=we and ofc>=1 and nct>=1 then ofc_majct= sum(ofc_majct,nct);

if dt >= wb and dt<=we and ip>=1 and nct>=1 then ip_majct= sum(ip_majct,nct);

if dt >= wb and dt<=we and op>=1 and nct>=1 then op_majct= sum(op_majct,nct);

if dt >= wb and dt<=we and ofc>=1 and pet>=1 then ofc_majpet= sum(ofc_majpet,pet);

if dt >= wb and dt<=we and ip>=1 and pet>=1 then ip_majpet= sum(ip_majpet,pet);

if dt >= wb and dt<=we and op>=1 and pet>=1 then op_majpet= sum(op_majpet,pet);

if dt >= wb and dt<=we and ofc>=1 and nperf>=1 then ofc_majperf= sum(ofc_majperf,nperf);

if dt >= wb and dt<=we and ip>=1 and nperf>=1 then ip_majperf= sum(ip_majperf,nperf);

if dt >= wb and dt<=we and op>=1 and nperf>=1 then op_majperf= sum(op_majperf,nperf);

   end;

  output;

end;

   if we =. then we=fst_srvc_dt;

      if wb=' ' then wb=fst_srvc_dt;

      if we=wb  then output;

drop wb we mem dt nct ncath pet nperf pt ip ofc op prov_tin_pci prov_tin_cabg

office_clinic inpatient_facility outpatient_facility prov_tin_fu_30 prov_tin_fu_182

prov_tin_pci prov_tin_cath prov_tin_ct prov_tin_pet prov_tin_secho prov_tin_tee

prov_tin_tte prov_tin_perf prov_tin_min_restudy;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Try moving the COMPRESS=NO system option before the SQL procedure or use cardiac.tinrestudy(POINTOBS=YES) when creating that dataset.

PG

PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

Try moving the COMPRESS=NO system option before the SQL procedure or use cardiac.tinrestudy(POINTOBS=YES) when creating that dataset.

PG

PG
tmm
Fluorite | Level 6 tmm
Fluorite | Level 6

That is the ticket. Thanks.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3041 views
  • 0 likes
  • 2 in conversation