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

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 676 views
  • 1 like
  • 4 in conversation