LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2012, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 24 Feb 2012 12:56:49 -0500
Reply-To:   Subhadra Srigiriraju <subhadrasri@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Subhadra Srigiriraju <subhadrasri@GMAIL.COM>
Subject:   Re: name of the open program
Comments:   To: mpajoh@odot.org
In-Reply-To:   <CAM+YpE-D4Kvib2aXmW+oht+6DK9RYP+BYKVOBfdhRMiC0dX0bQ@mail.gmail.com>
Content-Type:   text/plain; charset=ISO-8859-1

* VEXTFL file in sashelp library stores these file names. Here is the same program i used to determine the latest file opened and create logs and list files under the same name. Hope this helps.

proc* *sort* data=sashelp.vextfl out=vextfl;

by descending fileref;

where substr(fileref,*1*,*1*) eq "#" and find(xpath,'.sas') > *0*; *

run*; *

data* _null_;

set vextfl;

new_xpath_log=compbl(tranwrd(xpath,'SAS Programs','SAS Logs'));

new_xpath_lst=compbl(tranwrd(xpath,'SAS Programs','SAS Lst'));

if _n_=*1* then do;

call symputx('progname',compbl(xpath));

call symputx('logname',compbl(tranwrd(new_xpath_log,'.sas','.log')));

call symputx('lstname',compbl(tranwrd(new_xpath_lst,'.sas','.lst')));

end; *

run*;

%put progname=&progname;

On Fri, Feb 24, 2012 at 12:41 PM, Joe Matise <snoopy369@gmail.com> wrote:

> I think you're confusing 'running' with 'saved'. SAS doesn't have a > concept of 'running' really, but rather 'submitted statements' (you could > say it is 'running' when statements are being processed, but that clearly > does not apply here). Unless you're working in EG, perhaps, only because I > don't know much about EG. By default if you submit that code, you are > 'running' a program, and submitting that let statement counts. > > If I open SAS, and have two editor windows open, one with a saved program, > and one with a new editor window ("Untitled 1"), adding the let statement > (and a %put statement) will give me the name of the saved program if it's > added to that saved program, and will return null string if it's in > Untitled 1, both of which are the expected results. > > -Joe > > On Fri, Feb 24, 2012 at 11:34 AM, <mpajoh@odot.org> wrote: > > > Because if the program is not running this: > > %let FileNameExt = %sysget(SAS_EXECFILENAME); > > will return a null string. > > > > Thanks, > > > > Masoud > > > > > > > > > > *Joe Matise <snoopy369@GMAIL.COM>* > > Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> > > > > 02/24/2012 11:27 AM > > Please respond to > > Joe Matise <snoopy369@GMAIL.COM> > > > > To > > SAS-L@LISTSERV.UGA.EDU > > cc > > Subject > > Re: name of the open program > > > > > > > > > > What's the difference, in interactive mode? > > > > -Joe > > > > On Fri, Feb 24, 2012 at 10:51 AM, Masoud Pajoh <mpajoh@odot.org> wrote: > > > > > OK, this one gives the name of the program that is executing. > > > What I want is the name of the file that is just open in the enhanced > > > editor, but not executing. > > > > > > Thanks, > > > > > > Masoud > > > > > > > > > > > > > > > "Fehd, Ronald J. (CDC/OCOO/ITSO)" <rjf2@cdc.gov> > > > Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> > > > 02/24/2012 09:31 AM > > > Please respond to > > > "Fehd, Ronald J. (CDC/OCOO/ITSO)" <rjf2@cdc.gov> > > > > > > > > > To > > > SAS-L@LISTSERV.UGA.EDU > > > cc > > > > > > Subject > > > Re: name of the open program > > > > > > > > > > > > > > > > > > > > > This is a FAQ, which is covered on this page: > > > > > > > > > > > > http://www.sascommunity.org/wiki/Batch_processing_under_Windows#Program_Name > > > > > > > > > Ron Fehd MyProgram.sas maven > > > > > > > > > > -----Original Message----- > > > > From: owner-sas-l@listserv.uga.edu [ > > mailto:owner-sas-l@listserv.uga.edu <owner-sas-l@listserv.uga.edu>] > > > > On Behalf Of mpajoh@ODOT.ORG > > > > Sent: Friday, February 24, 2012 10:22 AM > > > > To: SAS-L@LISTSERV.UGA.EDU > > > > Subject: name of the open program > > > > > > > > All: > > > > If I have test.sas open in the enhanced editor, is there a way to > come > > > up with > > > > "test.sas" as the name open file programmatically. > > > > > > > > Thanks, > > > > > > > > Masoud > > > > > > -- > > > This message has been scanned for viruses and > > > dangerous content by MailScanner, and is > > > believed to be clean. > > > > > > > -- > > This message has been scanned for viruses and > > dangerous content by MailScanner, and is > > believed to be clean. > > > > > > >


Back to: Top of message | Previous page | Main SAS-L page