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

My problem: The path is not displayed in the same line as NOTE: (MYMACRO) XXOUTPATH=

%let xxoutpath=C:/Users/xxdemo/Documents/Dropbox/xxdemo/xxdemo_prod_programming/sas/val/mymacro/reporting;
%put %str(NOT)E: (MYMACRO) XXOUTPATH= &xxoutpath.;

It means that when I search for (MYMACRO) the path is not selected.

data _null_; 
    infile "&xxproject./log/tc001.log"; 
    file "&xxproject./log/review_tc001.log";
    input; 
     if index(_infile_,'(MYMACRO)') ne 0 then put _infile_; 
run

 

My current solution: create a shorter version of the path, keeping the last 60 characters or less.

data _null_;
    tmp=substr("&xxoutpath.",length("&xxoutpath.")-60); *keep the last 60 characters; 
    call symputx('xxoutpath_short','...' || substr(tmp,findc(tmp,'/')),'L');
    
    put _all_;
run;

%put &xxoutpath_short.;

I'm sure there is a smarter way to get a shorter version. So feel free to comment.

If you have a solution get everything kept in the selection, let me know too.

Cheers

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @xxformat_com,

 


@xxformat_com wrote:

My problem: The path is not displayed in the same line as NOTE: (MYMACRO) XXOUTPATH=


My SAS log displays it in the same line. I am using options ls=156, whereas your linesize is probably <117. If you don't want to increase it, you can write two lines after '(MYMACRO)' was found in _INFILE_:

do;
  put _infile_;
  input;
  put _infile_;
end;

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hi @xxformat_com,

 


@xxformat_com wrote:

My problem: The path is not displayed in the same line as NOTE: (MYMACRO) XXOUTPATH=


My SAS log displays it in the same line. I am using options ls=156, whereas your linesize is probably <117. If you don't want to increase it, you can write two lines after '(MYMACRO)' was found in _INFILE_:

do;
  put _infile_;
  input;
  put _infile_;
end;
xxformat_com
Barite | Level 11

Well spotted. Thanks. ls=98 by default in my SAS version.

I keep forgetting that ls and ps have no common default across SAS versions.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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