06-24-2019
Mxmaverick
Calcite | Level 5
Member since
05-24-2019
- 11 Posts
- 1 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by Mxmaverick
Subject Views Posted 1229 06-18-2019 07:16 PM 1225 06-18-2019 06:37 PM 1446 05-28-2019 06:03 PM 1457 05-28-2019 05:31 PM 1472 05-28-2019 05:11 PM 1487 05-28-2019 04:39 PM 2715 05-27-2019 12:41 PM 2788 05-24-2019 09:58 PM 2833 05-24-2019 04:08 PM 1056 05-24-2019 12:57 PM -
Activity Feed for Mxmaverick
- Posted Prompts to load data on SAS Programming. 06-18-2019 07:16 PM
- Posted Prompts - how to load data with prompts on SAS Programming. 06-18-2019 06:37 PM
- Posted Re: Error running code on server, but works fine on local on SAS Programming. 05-28-2019 06:03 PM
- Posted Re: Error running code on server, but works fine on local on SAS Programming. 05-28-2019 05:31 PM
- Posted Re: Error running code on server, but works fine on local on SAS Programming. 05-28-2019 05:11 PM
- Posted Error running code on server, but works fine on local on SAS Programming. 05-28-2019 04:39 PM
- Liked Re: Merge multiple .sas7bdat into one dataset for Reeza. 05-27-2019 12:42 PM
- Posted Re: Merge multiple .sas7bdat into one dataset on SAS Programming. 05-27-2019 12:41 PM
- Posted Re: Merge multiple .sas7bdat into one dataset on SAS Programming. 05-24-2019 09:58 PM
- Posted Merge multiple .sas7bdat into one dataset on SAS Programming. 05-24-2019 04:08 PM
- Posted Re: Import multiple xlsx files with multiple sheets on SAS Programming. 05-24-2019 12:57 PM
- Posted Import multiple xlsx files with multiple sheets on SAS Programming. 05-24-2019 11:46 AM
-
Posts I Liked
Subject Likes Author Latest Post 1
06-18-2019
07:16 PM
Hi everyone, I want to know if using the prompts I can load data directly to a dataset, and after that, a way that all this is showned inside the prompt, or something like a quick view of the table with the new data. Many thanks
... View more
06-18-2019
06:37 PM
Hi everyone, I want to know if using the prompts I can load data directly to a dataset, and after that, a way that all this is showned inside the prompt, or something like a quick view of the table with the new data. Many thanks
... View more
05-28-2019
06:03 PM
Seems legit, thank you very much.
... View more
05-28-2019
05:31 PM
I want the server to connect to my machine and find the files. Im using SAS GUIDE, so i just need to put an IP, port, user and password.
... View more
05-28-2019
05:11 PM
Not windows on server. UPDATE: i tried changing everything to just run on server and it works properly %let dir = /SASDATA/Proyectos/siavo3/prompts/Prueba/; libname INSUMOS "/SASDATA/Proyectos/siavo3/prompts"; but it's not what i want, and at least we know it's not the code
... View more
05-28-2019
04:39 PM
I everyone, im triying to make this code work on server, but it shows me the next error: WARNING: Argument 1 to function DNUM referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range. NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set to a missing value. ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &dnum ERROR: The %TO value of the %DO I loop is invalid. ERROR: The macro READ_FILES will stop executing. 89 Nevertheless, if i run the same code but with local, i dont get any error, everything works fine. Any clues? Many thanks! BTW This is the code i'm using: %let dir = C:\Users\....; libname INSUMOS "/SASDATA/...../"; %let libreria=INSUMOS.; options compress=yes; %macro read_files (dir, LIBRERIA); %let rc=%sysfunc(filename(rawdata,&dir)); %let did=%sysfunc(dopen(&rawdata)); %let dnum=%sysfunc(dnum(&did)); %do i=1 %to &dnum; %let name_file=%sysfunc(dread(&did,&i)); %let FORMATO=%sysfunc(scan(&name_file,2,.)); %if &FORMATO=xlsx %then %do; %let name_file_short=%sysfunc(scan(&name_file,1,.)); data _NULL_; *Extrae el nombre del archivo; FECHA=scan("&name_file_short",-1,"_"); call symput('FECHA', FECHA); run; PROC IMPORT OUT=&LIBRERIA.&name_file_short / DATAFILE="&dir\&name_file" DBMS=xlsx REPLACE; run; Data &libreria&name_file_short; SET &libreria&name_file_short; FECHA_NOMBRE= "&name_file_short"; FECHA2="&FECHA"; FECHA=input(FECHA2,DDMMYY8.); FORMAT FECHA DATE9.; DROP FECHA2; if RFC = " " then delete; RUN; %end; %end; data INSUMOS.tot_comb; set &LIBRERIA.EC:; run; %mend; %read_files(&dir, &libreria);
... View more
05-27-2019
12:41 PM
I finished by using this one: data tot_comb; set orion.total_:; run; Many thanks!!!!!!
... View more
05-24-2019
09:58 PM
I just want to append, the variables are correct, no problem with that.
... View more
05-24-2019
04:08 PM
I use the code above to create around 75 datasets from xlsx files. Now i want to merge those datasets into one, is there a way around? thanks %let dir= C:\Users\....; %let dor= C:\Users\......; libname orion "&dir"; libname dodo "&dor"; options compress=yes; options notes; %macro read_files (katalog); %let rc=%sysfunc(filename(rawdata,&katalog)); %let did=%sysfunc(dopen(&rawdata)); %let dnum=%sysfunc(dnum(&did)); %do i=1 %to &dnum; %let name_file=%sysfunc(dread(&did,&i)); %let rozszerz=%sysfunc(scan(&name_file,2,.)); %if &rozszerz=xlsx %then %do; %let name_file_short=%sysfunc(scan(&name_file,1,.)); PROC IMPORT OUT=dodo.&name_file_short DATAFILE="&katalog\&name_file" DBMS=xlsx REPLACE; sheet= Solicitudes; run; %end; %end; %mend; %read_files(&dir);
... View more
05-24-2019
12:57 PM
What I want is to import all files in a directory and at the same time, import specific sheets from those files
... View more
05-24-2019
11:46 AM
Hi everyone, I just wanted to know if anyone knows how to import many excel files and at the same time, import specific sheets from this files. I already have a macro that can do both process but separately. Thank in advance. BTW this are my two codes THIS ONE IMPORT MULTIPLE FILES %macro MultImp(dir=,out=); %let rc=%str(%'dir %")&dir.%str(\%" /A-D/B/ON%'); filename myfiles pipe %unquote(&rc); data list; length fname $256.; infile myfiles truncover; input myfiles $100.; fname=quote(upcase(cats("&dir",'\',myfiles))); out="&out"; drop myfiles; call execute(' proc import dbms=xlsx out= _test datafile= '||fname||' replace ; run; proc append data=_test base='||out||' force; run; proc delete data=_test; run; '); run; filename myfiles clear; %mend; proc import dbms=xlsx out= merged datafile= "C:\USERS\.....\.XLSX" replace ; run; %MultImp(dir=C:\Users\Usuario\Desktop\Prompts\Para_Promp_1\Originales\Empresas_Certificadas_V2\Empresas_Certificadas_Despacho_de_Mercancías_98LA,out=merged); and THIS ONE IMPORT MULTIPLE SHEETS %macro dataload(sheet); proc import out= &sheet datafile = 'C:\Users\...\.....xlsx' dbms = xlsx replace; sheet = "&sheet"; getnames = yes; run; %mend dataload; %dataload(sheet1); %dataload(sheet2);
... View more