07-10-2018
SteveDavies
Calcite | Level 5
Member since
04-16-2018
- 7 Posts
- 0 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by SteveDavies
Subject Views Posted 2756 07-10-2018 06:02 AM 2837 07-09-2018 09:06 AM 2849 07-09-2018 08:32 AM 2633 04-17-2018 08:27 AM 2647 04-17-2018 03:34 AM 2698 04-16-2018 09:30 AM 2720 04-16-2018 08:53 AM -
Activity Feed for SteveDavies
- Posted Re: PIPE and ways to get round it in Enterprise Guide on SAS Enterprise Guide. 07-10-2018 06:02 AM
- Posted Re: PIPE and ways to get round it in Enterprise Guide on SAS Enterprise Guide. 07-09-2018 09:06 AM
- Posted PIPE and ways to get round it in Enterprise Guide on SAS Enterprise Guide. 07-09-2018 08:32 AM
- Posted Re: How do I keep output without replacing or creating new program in EG on SAS Enterprise Guide. 04-17-2018 08:27 AM
- Posted Re: How do I keep output without replacing or creating new program in EG on SAS Enterprise Guide. 04-17-2018 03:34 AM
- Posted Re: How do I keep output without replacing or creating new program in EG on SAS Enterprise Guide. 04-16-2018 09:30 AM
- Posted How do I keep output without replacing or creating new program in EG on SAS Enterprise Guide. 04-16-2018 08:53 AM
07-10-2018
06:02 AM
Thank you to everyone who has responded. I have used bits of most of the replies and the code below now works for what I am needing. %let path='FILEPATH'; filename folder "&path"; data FilesInFolder; length Line 8 File $300; List = dopen('folder'); do Line = 1 to dnum(List); File = trim(dread(List,Line)); output; end; drop list line; run; data _NULL_; set FilesInFolder end=final; call symput(cats('File', _N_), trim(File)); call symput(cats('Name', _N_), trim(nliteral(substr(File,1,min(32, length(File)-4))))); if final then call symputx(trim('Total'), _N_); run; %macro loop_test; %do i = 1 %to &Total; %put &&File&i; %put %sysfunc(find(&&File&i,xls)); %if %sysfunc(find(&&File&i,xls)) %then %do; PROC IMPORT OUT=orig_test&i. DATAFILE="FILEPATH" DBMS=EXCEL REPLACE; GETNAMES=YES; SHEET="Sheet"; RUN; %end; %end; %mend; %loop_test;
... View more
07-09-2018
09:06 AM
Thank you, I will see if our SAS administrator can do that. Is it a function that is easily amended or is it something that may not be available on all systems? Is there a way round it if it doesn't work? Thanks
... View more
07-09-2018
08:32 AM
Hi I usually run a bit of code in Base SAS and it always runs fine. We have moved to EG and it now doesn't allow me to run it due to "Insufficient Authorization to access PIPE". The code is below, is anyone able to provide a solution to reading in lots of differently named spreadsheets and retain the information required from each spreadsheet (where DIRECTORY_NAME is my library path)? Thanks %LET dir = "DIRECTORY_NAME"; %let DIRLIST = %UNQUOTE(%STR(%'for /r &dir. %I in (*.XLS*) do @echo %~ztfI%')); filename DIRLIST pipe &DIRLIST.; data out1_orig; infile dirlist length=reclen truncover; input line $varying256. reclen; FORMAT DATE DDMMYY10. TIME $5. FILESIZE comma15. FILENAME $200. ; reclen=reclen; Date = input(substr(line,1,10), ?? ddmmyy10.); Time = scan(line,2,' '); Filesize = scan(line,3,' '); call scan(line,4,pos,len,' ');pos = pos/*-1*/; FileName = substr(line,pos,reclen-pos); MonthGrp = PUT(intnx('month',Date,0,'e'),YYMMN7.); GrpNum = intnx('month',Date,0,'e'); posFS = prxmatch("|\\[^\\]*$|", FileName); FileFolderOnly = substr(line,pos,posFS); FileNameOnly = substr(line,pos+posFS,reclen-pos); run;
... View more
04-17-2018
08:27 AM
Ok, Thanks. it seems like there isn't a way to do it the same way as in Base SAS without writing additional code for something that should be really easy to do. Just another failing of Enterprise Guide hey!
... View more
04-17-2018
03:34 AM
Hopefully the example below might help with what I am asking: proc means data=test n mean; var age; class sex; run; proc means data=test n mean; var age; class sex; where num_children eq 0; run; If I run the first proc means in Base SAS review the output, then decide I want to see a comparison of the results where number of children is zero, I can run the second proc means and see the average ages of the two proc means in the same output window. If I do the same in EG I could run the first one and see the output. When trying to run the second one it would ask me to replace or open it up in a new program. I don't want to do either because I want a comparison so I don't want to replace, and I don't want other programs being opened. To get them in the same output window I would need to run both bits of code at the same time. If they take time to run, or have other code in between this is not optimal. Hopefully this makes it clearer. Thanks
... View more
04-16-2018
09:30 AM
Thanks, so it can't be done like it is in base SAS without copying or creating a new program?
... View more
04-16-2018
08:53 AM
Hello I'm looking for someone to help me with Enterprise Guide (7.11) if you can. I'm usually a Base SAS user and would quite often run a bit of code, review the results, then run the next bit of code and compare the results in the same output window. In EG it always pops up asking whether I want to replace results from previous run, or save changes to a new program. I don't want to do either. I want the same results in the same program so that I can then compare results without having two programs open. I know you can remove the pop up box and always accept the replacement, but this is not the option I need to compare results. How do you compare results if running code in steps? Thanks
... View more