Hello,
I am adding a new variable into a spde dataset, thereafter I am doing a proc compare.
But I am getting different variables length while it is not the case.
Can I trust my new datasets? Why are we getting those results?
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;
Extract of the log:
I see no difference other than variable LABEL. Based on the PROC COMPARE output.
I would like to know why when we add just one more variable like orgnl_sas_ds_row_nbr, the label into the new dataset become blank instead of transfering the previoius label.
How to correct that issue?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.