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-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!

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.

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
  • 1 reply
  • 226 views
  • 0 likes
  • 2 in conversation