BookmarkSubscribeRSS Feed
tekish
Quartz | Level 8

Dear experts,

I have a large excel file which i want to do error check for quality control report. After importing to SAS i want to do the following the quality control checks that need to be performed on the catalog file:

 

  • Check that the Cata ID1 is unique for each record.
  • Check that the non-missing catalog course IDs are unique within each course.
  • Check that all  level follow the XX-XX format.

 

libname xlsx "c\temp\catalog.xlsx";

example data:

infile xlsx;

Cata ID1Cata ID2Cata Course TitleLevelSCEDCourse LevelCreditSeq/TotalSpec.EdCourse languageOnline
1 00128Project ManagementI-IV 22998G1 1/16NEnglishN
2 00300IT and Computer ScienceI-III 22004G4 1/1NFrenchY
3 00400CybersecurityI-IV 22004G0.5 1/1NEnglishY
4 00107ManagementI-IV 22004G0.5 1/1NFrenchN
5 01111SQLI-III 01001G0.5 1/1NEnglishN
6 01112SASI-III 01002G3 1/1NEnglishN
7 01113.NETI-II 01003G0.5 1/1NSpanshN
8 01114SharepointI-V 01004G0.5 1/1NEnglishN
9 01350RI-V 22003G0.5 1/1NEnglishN

 Any idea and suggestion would be appreciated.

 

Thanks

1 REPLY 1
Kurt_Bremser
Super User

You can use SQL and compare if count(distinct cat_id1) equals count(cata_id1), similar for other variables that need to be unique.

The check for the format can be done by controlling for countw(level,'-') = 2.

For detailed help, show the code you already tried.

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