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

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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