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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 610 views
  • 0 likes
  • 2 in conversation