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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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