BookmarkSubscribeRSS Feed
jojo
Obsidian | Level 7

  I want to identify the max value of one variable among all identical datasets (have same variables in each dataset) created and saved under work and exact the row. But got a note:

NOTE: A stored DATA STEP view cannot run under a different operating system.

data allscan/view = allscan;

     set optimal_:indsname=dsname;

                 run;

proc sql;

create table min as

select * from allscan

having EN=min(EN);

quit;

 

 

NOTE: DATA STEP view saved on file WORK.ALLSCAN.

NOTE: A stored DATA STEP view cannot run under a different operating system.

NOTE: DATA statement used (Total process time):

real time 0.03 seconds

cpu time 0.01 seconds

 

ERROR: The following columns were not found in the contributing tables: EN.

NOTE: View WORK.ALLSCAN.VIEW used (Total process time):

real time 0.01 seconds

cpu time 0.01 seconds

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE SQL used (Total process time):

real time 0.03 seconds

cpu time 0.03 seconds

2 REPLIES 2
PGStats
Opal | Level 21

A Note is just a note, it doesn't signal an error. The error seems to be that at least one of your WORK.OPTIMAL_* datasets doesn't include a variable called EN. - PG

PG
jojo
Obsidian | Level 7

I used the %sysfunc to check the nobs and delete it if it is empty. But it seems that the empty datasets were still there.

%do i = 2 %to &maxN;

    %joint(&i,&i); *** create table optimal_&i;

         *** check if the data is empty;

        %LET dsid=%SYSFUNC(OPEN(work.optimal_&i));

     %LET nobs=%SYSFUNC(ATTRN(&dsid.,NOBS));

     %LET rc=%SYSFUNC(CLOSE(&dsid.));

     %IF &Nobs. EQ 0 %THEN %DO;

            proc datasets;

                 delete optimal_&i;

               run;

     %END;

%end;

data allscan/view = allscan;

     set optimal_:indsname=dsname;

        run;

proc sql;

create table opt as

select * from allscan

having EN=min(EN);

quit;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 862 views
  • 0 likes
  • 2 in conversation