BookmarkSubscribeRSS Feed
Babloo
Rhodochrosite | Level 12

Could someone of you help me to know how can I find the output file (outfr14a,outfr14b,outfr14) location from the following code?

 

if agi ne agi_v           
    then do;                
      knkbty = '1';         
      knkatv = '' ;         
      knkath = '' ;         
      agiteg = agi;         
      link schrijfv;        
                            
      knkbty = '2';         
      knkatv = '' ;         
      knkath = '' ;         
      agiteg = agi_v;       
      link schrijfh;        
                        end;                                 
    end;                                     
                                             
return;                                      
schrijfh:                                    
  *schrijf weg met huidige gegevens;         
     p2kbrn='7';                             
  if substr(khiref,1,1)  = '1' then do;      
  file outfr14a noprint notitles;            
  link fr14outh;                             
  end;                                       
  if substr(khiref,1,1)  = '2' then do;      
  file outfr14b noprint notitles;            
  link fr14outh;                             
  end;                                       
  else if substr(khiref,1,1)  = '0' then do; 
  file outfr14 noprint notitles;             
  link fr14outh;                             
  end;                                       
          return;                                      
                                             
return;                                      
schrijfv:                                    
  p2kbrn='7';                                
  if substr(khiref,1,1)  = '1' then do;      
  file outfr14a noprint notitles;            
  link fr14outv;                             
  end;                                       
  else if substr(khiref,1,1)  = '2' then do; 
  file outfr14b noprint notitles;            
  link fr14outv;                             
  end;                                       
  else if substr(khiref,1,1)  = '0' then do; 
  file outfr14 noprint notitles;             
  link fr14outv;                             
  end;                                       
  * schrijf weg met huidige gegevens ;       
return;                                      

return;               
8 REPLIES 8
SASKiwi
PROC Star

That is impossible from just the code you have provided. outfr14a,outfr14b,outfr14 are file references that have been defined somewhere else, perhaps in a FILENAME statement. Start by looking through the rest of your program for other statements that use those references.

Oligolas
Barite | Level 11

Hi, if filename have been defined you can use pathname()

 

%let outfr14aLoc = %sysfunc(pathname(outfr14a));

%let outfr14bLoc = %sysfunc(pathname(outfr14b));

%let outfr14Loc = %sysfunc(pathname(outfr14));

________________________

- Cheers -

Oligolas
Barite | Level 11

and if not.. I presume it will Output a dat file into the Default Output Location defined in SAS. But I haven't found a way to identify it during a SAS session:
screenshot_04.png

________________________

- Cheers -

FreelanceReinh
Jade | Level 19

@Oligolas wrote:

I presume it will Output a dat file into the Default Output Location defined in SAS. But I haven't found a way to identify it during a SAS session:
screenshot_04.png


The path of this so called "current working directory" (not to be confused with the WORK library) can be found as follows (at least on Windows systems):

filename dummy '.'; 
%put %sysfunc(pathname(dummy));

 

Oligolas
Barite | Level 11
@FreelanceReinhard Excellent thank you very much 🙂
________________________

- Cheers -

Amir
PROC Star

Hi,

 

Am I missing something, or could this information be found in the log?

 

 

Regards,

Amir.

andreas_lds
Jade | Level 19

@Amir wrote:

Hi,

 

Am I missing something, or could this information be found in the log?

 

 

Regards,

Amir.


To simple 😉

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 8 replies
  • 835 views
  • 3 likes
  • 6 in conversation