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

Hi,

I am facing issue related to macro. I have created macro Trans_data_IncrementLoad and  Business_freez_dates which contains multiple do loop and if condition. In Trans_data_IncrementLoad  macro there are multiple do loop and inside one of do loop I am using oracle pass through , which insert data into trans_data table by joining 2 table.

 

Macro Business_freez_dates  also contains multiple do loops and if condition and it create the dataset which contains the business date's for which incremental load should happen.

 

once dataset created which contains the business date's for which incremental load should happen, I'm calling Trans_data_IncrementLoad macro from data step.

 

Issue facing: Now issue is that most of the time my code running successfully but sometime it seems that code not completing it's execution. ex: suppose 100 obs needed to be inserted into trans_data but it inserting only 10 obs in trans_data table, but later if I run the code again then it properly inserting 100 obs in trans_data. I am really not able to figure out why this kind of issue coming. I am attaching the screenshot of code structure, it's not entire code but sample of code.

screenshot 1:

Kaps_0-1669123968377.png

Screenshot 2:

Kaps_1-1669124059130.png

screenshot 3:

Kaps_3-1669124155300.png

Thanks in advance for your valuable solution/suggestion/advice and would be very grateful for your valuable input.

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

That's too much code to "dry troubleshoot".

Check the log with all possible troubleshooting options active, like:

options symbolgen mprint mlogic msglevel=i sastrace=',,,d' sastraceloc=saslog nostsuffix;
Data never sleeps

View solution in original post

5 REPLIES 5
LinusH
Tourmaline | Level 20

That's too much code to "dry troubleshoot".

Check the log with all possible troubleshooting options active, like:

options symbolgen mprint mlogic msglevel=i sastrace=',,,d' sastraceloc=saslog nostsuffix;
Data never sleeps
Kaps
Calcite | Level 5

Thanks for your reply.

Yes,I have included all the option in my code which helps in macro code debugging, but the issue is that it didn't generate any kind of error in log.

 

Can you confirm once, Am I calling macro in correct way?(the one from datastep). any suggestion would you like to give on macro calling for which I should be careful.

 

 

Thanks

Quentin
Super User

Do you ever get any errors/warnings in the log?  Is there any pattern to when the code 'works'?

 

Can you post the full log from a run where the code works, and the full log from a run when the code doesn't work?  If you can post those logs (as text) you should be able to compare them (and in particular record counts) to see where they start to differ.

The Boston Area SAS Users Group is hosting free webinars!
Next up: Joe Madden & Joseph Henry present Putting Power into the Hands of the Programmer with SAS Viya Workbench on Wednesday Nov 6.
Register now at https://www.basug.org/events.
PaigeMiller
Diamond | Level 26

Code needs to be provided as text, in the window that appears when you click on the "little running man" icon. Do not provide code as screen captures.

 

If there are errors in the log, show us the ENTIRE log (not selected parts of the log, not just the errors, not what you think we need, we want to see the ENTIRE log). Logs should be provided as text (not screen captures), pasted into the window that appears when you click on the </> icon.

PaigeMiller_0-1663012019648.png

 

Do not ignore these instructions.

--
Paige Miller
Kaps
Calcite | Level 5

Thanks for your valuable advice and Yes, will take of this in next post

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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