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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 314 views
  • 1 like
  • 4 in conversation