BookmarkSubscribeRSS Feed
kalbo
Obsidian | Level 7

Hi, I have a question.

 

In my SAS log, I there are many occurrences of the following text which is split over 2 lines for example.

NOTE: The above message was for the following BY group:
Unique Subject Identifier=ABCD-123-4567-ABC0001-027 DAGRPID=DA

 

This text is "buried" in other varying text, example below:

 

ERROR: The ID value "XITDISP" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
Unique Subject Identifier=ABCD-123-4567-ABC0001-027 DAGRPID=DA
ERROR: The ID value "XITDISP" occurs twice in the same BY group.
ERROR: The ID value "XITDISP" occurs twice in the same BY group.
ERROR: The ID value "XITDISP" occurs twice in the same BY group.

 

I want to read in only the 2 lines I mention at the top of my post and store all of those in a data set. There are many occurrences of these 2 lines throughout my log file and the text above and below varies.

 

Any help would be apreciated.

 

Thanks.

1 REPLY 1
Reeza
Super User
Why? Perhaps query the data set directly to find those cases instead?

If you're looking for generic log parsers, try searching lexjansen.com for many written examples.

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!

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
  • 355 views
  • 0 likes
  • 2 in conversation