BookmarkSubscribeRSS Feed
sonikm24
Calcite | Level 5

Hello,

           I have using a web crawler to find multiple instances of keywords (in the code I am searching for "Notional") from sec files (see the code attached). I am using the prxnext function to do the job. But I am having a problem when I am trying to output lines surrounding the keywords. I am trying to increase the output lines for every instance of the keyword in the sec file. E.g. if there are 5 instances of "Notional" in the sec file, i am trying to output lines surrounding each one of the instances of the keyword (see the attached sas code)

But this code is not able to increase or decrease the output lines surrounding the keywords even by changing 10 to 15 or 5. Can anyone help with the issue? I have attached the code and a sample excel file.

Thanks.

Sonik Mandal

1 REPLY 1
mfab
Quartz | Level 8

Hello @sonikm24,

 

could you please provide an example that is describing the problem?

Your excel-file seems to contain no information and your dataset 'sonik' is missing. It would be best, if you could provide some sample dataset, so that we can work on the problem without having to crawl the websites.

 

From what I understand, you want to output certain rows of a dataset.

For instance row 50, because some condition applies and then you also want row 49 and row 51, because they surround row 50?!

 

There are a number of ways, you could achieve that. Possibly a retain statement (with optional by-processing) could do the trick.

Another option would be to use a hash and hash-iterator.

 

Cheers,

Michael

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