BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ravi999985
Calcite | Level 5

I have a code of 4000 lines having base and advance SAS. I have to debug that code. Is there any method or what is the best ways to debug a large code.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Run the code step by step; after each submit:

  • check for ERROR messages, and fix the code if such appear
  • check for WARNING messages, and do the same
  • check for any NOTEs beyond "dataset x was created with y observations and z variables". Get also rid of those. This includes NOTEs for uninitialized variables, automatic conversions numeric<>character, missing values being created (if such NOTEs are acceptable, document this in comments)
  • check the resulting dataset(s) if they meet your expectations

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

See Maxim 2

--
Paige Miller
ballardw
Super User

Details. What needs "debugging"?

 

Have you verified that the starting data is "correct" for the processes you expect to run.

 

Do you read the LOG when the code runs? That typically is the start of any "debug" process as it will show where you have errors, how many observations are used by steps (if you see 0 that likely indicates a problem with the content of an input data set), result size of data sets. Also warnings and errors. If you are seeing those then share the log.

 

If you have questions then showing the log with the code and all the messages is the best way to present information. Open a text box on the forum with the </> icon above the message window, copy the text from the log and then paste it into text box. The text box is important as the message windows on this forum will reformat text meaning that the diagnostic indications SAS often provides will not appear in the correct location reducing their usefulness.

Kurt_Bremser
Super User

Run the code step by step; after each submit:

  • check for ERROR messages, and fix the code if such appear
  • check for WARNING messages, and do the same
  • check for any NOTEs beyond "dataset x was created with y observations and z variables". Get also rid of those. This includes NOTEs for uninitialized variables, automatic conversions numeric<>character, missing values being created (if such NOTEs are acceptable, document this in comments)
  • check the resulting dataset(s) if they meet your expectations

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
  • 3 replies
  • 1062 views
  • 1 like
  • 4 in conversation