BookmarkSubscribeRSS Feed
alepage
Barite | Level 11

Hello,

 

I adding the variable ORGNL_SAS_DS_ROW_NBR and it works fine. But if we make a proc compare, we see that in the original dataset the lable are present and in the new dataset all the label seems to be blank.  How to solve that issue ?

 

libname  BANDE1 spde '/.../Temp/Alain/test/Classic/gc/auto';
libname  BANDE2 spde '/.../Temp/Alain/test/Classic/gc/habi';
libname  BANDE3 spde '/.../Temp/Alain/test/Classic/gc/entr';

libname  BANDE4 spde '/.../Temp/Alain/test/Classic/gc2/auto';
libname  BANDE5 spde '/.../Temp/Alain/test/Classic/gc2/habi';
libname  BANDE6 spde '/.../Temp/Alain/test/Classic/gc2/entr';

%let co=gc;
%let moisc=feb;
%let year=2025;

Data BANDE4.&CO._AUTO_PRM&MOISC.&YEAR. ;
ORGNL_SAS_DS_ROW_NBR=_N_;
set BANDE1.&CO._AUTO_PRM&MOISC.&YEAR. ;
run;

/****** Bande2 for Property *****/

Data BANDE5.&CO._PROP_PRM&MOISC.&YEAR. ;
ORGNL_SAS_DS_ROW_NBR=_N_;
set BANDE2.&CO._PROP_PRM&MOISC.&YEAR. ;
run;

/****** Bande3 for Enterprise *****/
data BANDE6.&CO._CNA_PRM&MOISC.&YEAR. ;
ORGNL_SAS_DS_ROW_NBR=_N_;
set BANDE3.&CO._CNA_PRM&MOISC.&YEAR. ;
run;

/****** The proc compare steps *********/

proc compare base=bande1.&CO._AUTO_PRM&MOISC.&YEAR. compare=BANDE4.&CO._AUTO_PRM&MOISC.&YEAR. 
listvar;
run;
proc compare base=bande2.&CO._prop_PRM&MOISC.&YEAR. compare=BANDE5.&CO._prop_PRM&MOISC.&YEAR. 
listvar ;
run;
proc compare base=bande3.&CO._CNA_PRM&MOISC.&YEAR.  compare=BANDE6.&CO._CNA_PRM&MOISC.&YEAR.  
listvar ;
run;

alepage_1-1742850232558.png

1 REPLY 1
Tom
Super User Tom
Super User

Looks like you turned off the LABEL option.

 

Example:

data class;
  set sashelp.class;
  label name='Student Name';
run;
options nolabel;
data class2; set class; run;
options label;
data class3; set class; run;
proc compare data=class compare=class2;
run;
proc compare data=class compare=class3;
run;

Tom_1-1742912222990.png

 

Tom_0-1742912176830.png

 

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 1301 views
  • 4 likes
  • 2 in conversation