<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using macros to import ssp file in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781195#M31739</link>
    <description>Ok, thanks&lt;BR /&gt;</description>
    <pubDate>Fri, 19 Nov 2021 07:56:48 GMT</pubDate>
    <dc:creator>Banke</dc:creator>
    <dc:date>2021-11-19T07:56:48Z</dc:date>
    <item>
      <title>Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780889#M31674</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;please I am trying to import a dataset of ssp file using a simple macro but my log says i cant use DBMS for an ssp file. How can I go about this please?&lt;/P&gt;
&lt;P&gt;I saw a more complicated code online that&amp;nbsp; can be used to extract the file directly from the zipped folder in the direct source link but that didnt work too&lt;/P&gt;
&lt;P&gt;I have posted the two codes and the log error.&lt;/P&gt;
&lt;P&gt;Thanks a lot&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;&lt;CODE class=" language-sas"&gt;/**first code**/&lt;BR /&gt;&lt;BR /&gt;%macro import(meps);

FILENAME HI63 'C:\Users\HP SPECTRE\Documents\meps directory\consolidated\H163.SSP';

PROC IMPORT DATAFILE=HI63 DBMS=SSP OUT=&amp;amp;MEPS. REPLACE; 
GETNAMES=YES;
RUN;
%mend import;

%import (H171);
%import (H181);

run;&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;STRONG&gt;&lt;CODE class=" language-sas"&gt;/**the second code i got online for getting the dataset  directly from the website**/
%let meps_file = h206b;
%let meps_url = https://meps.ahrq.gov/mepsweb/data_files/pufs/h206b/h206bv9.zip;
%let meps_dir = C:/MEPS/sas_data;


/* DO NOT EDIT this section *******************************/
/* Download zip file from MEPS website to specified directory (meps_dir) */
filename zipfile "&amp;amp;meps_dir/&amp;amp;meps_file.v9.zip";

proc http 
	url = "&amp;amp;meps_url"
	out = zipfile;
run;

/* Unzip SAS dataset and save in specified directory */
filename inzip ZIP "&amp;amp;meps_dir/&amp;amp;meps_file.v9.zip";	
filename sasfile "&amp;amp;meps_dir/&amp;amp;meps_file..sas7bdat" ;
 
data _null_;
	infile inzip(&amp;amp;meps_file..sas7bdat) 
	  lrecl=256 recfm=F length=length eof=eof unbuf;
   file sasfile lrecl=256 recfm=N;
   input;
   put _infile_ $varying256. length;
   return;
 eof:
   stop;
run;
/* End of DO NOT EDIT section ***************************/

/* Read in the saved SAS V9 dataset */
data dn2018;
	set "&amp;amp;meps_dir/&amp;amp;meps_file..sas7bdat";
run;

/* View first 5 rows of dataset */
proc print data = dn2018 (obs = 5);
run;&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;STRONG&gt;Log  error for the first code

 

ERROR: DBMS type SSP not valid for import.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

ERROR: DBMS type SSP not valid for import.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

49
50   run;
&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;STRONG&gt;error for the secon code

ERROR: Entry h155.sas7bdat in zip file C:\Users\HP SPECTRE\Documents\meps directory\h155v9.zip does not exist.
ERROR: Physical file does not exist, h155.sas7bdat.
NOTE: UNBUFFERED is the default with RECFM=N.
NOTE: The file SASFILE is:
      Filename=C:\Users\HP SPECTRE\Documents\meps directory\h155.sas7bdat,
      RECFM=N,LRECL=256,File Size (bytes)=0,
      Last Modified=17Nov2021:15:39:25,
      Create Time=17Nov2021:15:39:25
&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:06:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780889#M31674</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-11-17T22:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780891#M31675</link>
      <description>&lt;P&gt;What is an SSP file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From now on, please do not separate the error message from the code. Show us the WHOLE complete entire log.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780891#M31675</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-17T22:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780895#M31677</link>
      <description>&lt;P&gt;It is a type of file extension. This code worked but im trying learn to use macros&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME MEPS 'C:\Users\HP SPECTRE\Documents\meps directory';
FILENAME H163 'C:\Users\HP SPECTRE\Documents\meps directory\consolidated\H163.SSP';
PROC XCOPY IN = H163 OUT = MEPS IMPORT;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;these are the complete logs for the macros i used&lt;/P&gt;
&lt;PRE&gt;/**for first code**/&lt;BR /&gt;&lt;BR /&gt; %macro import(meps);
39
40   FILENAME HI63 'C:\Users\HP SPECTRE\Documents\meps directory\consolidated\H163.SSP';
41
42   PROC IMPORT DATAFILE=HI63 DBMS=SSP OUT=&amp;amp;MEPS. REPLACE;
43   GETNAMES=YES;
44   RUN;
45   %mend import;
46
47   %import (H171);
ERROR: DBMS type SSP not valid for import.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

48   %import (H181);


ERROR: DBMS type SSP not valid for import.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

49
50   run;


&lt;/PRE&gt;
&lt;PRE&gt;/** second log for the second code**/

%let meps_file = h163;
3    %let meps_url = https://meps.ahrq.gov/mepsweb/data_files/pufs/h163ssp.zip;
4    %let meps_dir = C:\Users\HP SPECTRE\Documents\meps directory;
5
6
7    /* DO NOT EDIT this section *******************************/
8    /* Download zip file from MEPS website to specified directory (meps_dir) */
9    filename zipfile "&amp;amp;meps_dir/&amp;amp;meps_file.v9.zip";
10
11   proc http
12       url = "&amp;amp;meps_url"
13       out = zipfile;
14   run;

NOTE: 200 OK
NOTE: PROCEDURE HTTP used (Total process time):
      real time           1.68 seconds
      cpu time            0.23 seconds


15
16   /* Unzip SAS dataset and save in specified directory */
17   filename inzip ZIP "&amp;amp;meps_dir/&amp;amp;meps_file.v9.zip";
18   filename sasfile "&amp;amp;meps_dir/&amp;amp;meps_file..sas7bdat" ;
19
20   data _null_;
21       infile inzip(&amp;amp;meps_file..sas7bdat)
22         lrecl=256 recfm=F length=length eof=eof unbuf;
23      file sasfile lrecl=256 recfm=N;
24      input;
25      put _infile_ $varying256. length;
26      return;
27    eof:
28      stop;
29   run;

ERROR: Entry h155.sas7bdat in zip file C:\Users\HP SPECTRE\Documents\meps directory\h155v9.zip does not exist.
ERROR: Physical file does not exist, h155.sas7bdat.
NOTE: UNBUFFERED is the default with RECFM=N.
NOTE: The file SASFILE is:
      Filename=C:\Users\HP SPECTRE\Documents\meps directory\h155.sas7bdat,
      RECFM=N,LRECL=256,File Size (bytes)=0,
      Last Modified=17Nov2021:15:39:25,
      Create Time=17Nov2021:15:39:25

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.00 seconds


30   LIBNAME MEPS 'C:\Users\HP SPECTRE\Documents\meps directory';
NOTE: Libref MEPS was successfully assigned as follows:
      Engine:        V9
      Physical Name: C:\Users\HP SPECTRE\Documents\meps directory
31   FILENAME H163 'C:\Users\HP SPECTRE\Documents\meps directory\consolidated';
32   PROC XCOPY IN = H163 OUT = MEPS IMPORT;
NOTE: Writing HTML Body file: sashtml.htm
33   RUN;

NOTE: Input library H163 is sequential.
ERROR: Invalid file, C:\Users\HP SPECTRE\Documents\meps directory\consolidated.
NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE XCOPY used (Total process time):
      real time           0.53 seconds
      cpu time            0.32 seconds

NOTE: The SAS System stopped processing this step because of errors.
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:25:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780895#M31677</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-11-17T22:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780897#M31678</link>
      <description>&lt;P&gt;Yes, I know its a file extension. What is in the file? Text? Hexadecimal characters? Something else?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would macros help here?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780897#M31678</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-17T22:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780898#M31679</link>
      <description>Text&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780898#M31679</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-11-17T22:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780899#M31680</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When looking on the web I think &lt;SPAN&gt;&lt;EM&gt;SSP&lt;/EM&gt; is a &lt;EM&gt;file&lt;/EM&gt; extension commonly associated with &lt;EM&gt;SAS&lt;/EM&gt; Transport Data Format &lt;EM&gt;files&lt;/EM&gt;&lt;/SPAN&gt;&lt;EM&gt;.&lt;/EM&gt; (Although I had never come across it before).&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;EM&gt;SAS&lt;/EM&gt; transport (.&lt;EM&gt;ssp&lt;/EM&gt;) &lt;EM&gt;files&lt;/EM&gt; can be read into &lt;EM&gt;SAS&lt;/EM&gt; using PROC &lt;EM&gt;XCOPY&lt;/EM&gt; &lt;/SPAN&gt;&lt;EM&gt;.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:33:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780899#M31680</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-17T22:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780900#M31681</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/394970"&gt;@Banke&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Text&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Repeating: "How would macros help here?"&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;What would the macro do?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:36:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780900#M31681</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-17T22:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780904#M31684</link>
      <description>Thanks a lot Koen. I used proc xcopy and it actually worked. I dont know how use macro with it however. I am going to import a lot of the datasets, so i am asked to use macros to achieve that</description>
      <pubDate>Wed, 17 Nov 2021 22:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780904#M31684</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-11-17T22:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780905#M31685</link>
      <description>&lt;P&gt;Thanks a lot Koen. I used proc xcopy and it actually worked but I dont know how to use macros with it. I want to import many datasets of the ssp file and merge&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780905#M31685</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-11-17T22:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780906#M31686</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can put all .ssp files of a particular directory on your file system in a SAS dataset (with or without including the full directory path). You can do that using code of course (no hard-coding of the file names needed)!&lt;/P&gt;
&lt;P&gt;Then you need to loop over the records in that SAS dataset using a macro.&lt;/P&gt;
&lt;P&gt;In every loop you pick up another file and import it with XCOPY procedure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this what you want to do with the macro?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780906#M31686</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-17T22:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780907#M31687</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/394970"&gt;@Banke&lt;/a&gt;&amp;nbsp;SSP files can also be HTML/web files so it's important to detail a bit what you're trying to do here especially when dealing with acronyms.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://fileinfo.com/extension/ssp#:~:text=An%20SSP%20file%20is%20a,are%20evaluated%20to%20page%20text.&amp;amp;text=SSP%20files%20can%20be%20evaluated,used%20to%20generate%20web%20documents" target="_blank"&gt;https://fileinfo.com/extension/ssp#:~:text=An%20SSP%20file%20is%20a,are%20evaluated%20to%20page%20text.&amp;amp;text=SSP%20files%20can%20be%20evaluated,used%20to%20generate%20web%20documents&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typically when converting in batch, you either create a list of input files and process them in a loop or if there's a naming convention you can create your loop manually without the list of files.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So first:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Get a list of files you need to process. See the third link below or &lt;A href="https://support.sas.com/kb/24/820.html" target="_self"&gt;here&lt;/A&gt; if you need help with that.&lt;/LI&gt;
&lt;LI&gt;Make working code for one iteration - you have that now.&lt;/LI&gt;
&lt;LI&gt;Figure out how to execute that for all files - see second link for that one.&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UCLA introductory tutorial on macro variables and macros&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Tutorial on converting a working program to a macro&lt;BR /&gt;&lt;BR /&gt;This method is pretty robust and helps prevent errors and makes it much easier to debug your code. Obviously biased, because I wrote it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Examples of common macro usage&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:53:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780907#M31687</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-17T22:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780908#M31688</link>
      <description>Yes, that's what i want to do&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 17 Nov 2021 22:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780908#M31688</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-11-17T22:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780910#M31689</link>
      <description>Thanks a lot, I will try it</description>
      <pubDate>Wed, 17 Nov 2021 22:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780910#M31689</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-11-17T22:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780911#M31690</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try to start from here :&lt;/P&gt;
&lt;P&gt;SAS 9.4 / Viya 3.5&lt;BR /&gt;Macro Language Reference guide&lt;BR /&gt;Example 1: Import All CSV Files That Exist within a Directory&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n0ctmldxf23ixtn1kqsoh5bsgmg8.htm?homeOnFail" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n0ctmldxf23ixtn1kqsoh5bsgmg8.htm?homeOnFail&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;... and let us know if you succeed.&lt;/P&gt;
&lt;P&gt;PROC IMPORT should be replaced by PROC XCOPY of course (and .csv by .ssp).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 23:02:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/780911#M31690</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-17T23:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781195#M31739</link>
      <description>Ok, thanks&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Nov 2021 07:56:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781195#M31739</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-11-19T07:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781196#M31740</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;&amp;nbsp;I can't find any official documentation of the XCOPY procedure on documentation.sas.com. Is there any resource for this procedure?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 08:30:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781196#M31740</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-19T08:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781198#M31741</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did not know PROC XCOPY either.&lt;/P&gt;
&lt;P&gt;It appears in the documentation in examples where they are dealing with&amp;nbsp;the Medical Expenditure Panel Survey (MEPS) data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like here :&lt;BR /&gt;SAS/STAT® 15.2 User's Guide&lt;BR /&gt;The SURVEYLOGISTIC Procedure&lt;BR /&gt;Example 119.2 The Medical Expenditure Panel Survey (MEPS)&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/statug/15.2/statug_surveylogistic_examples02.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/statug/15.2/statug_surveylogistic_examples02.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;But I cannot find "official" PROC XCOPY doc (the way other procedures are documented). Not on the web and not in the Windows help that comes with my SAS 9.4 M7 localhost installation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Strange indeed!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 08:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781198#M31741</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-19T08:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781199#M31742</link>
      <description>&lt;P&gt;Update:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks all for your inputs.&lt;/P&gt;
&lt;P&gt;So i have tried using some macros, here is one I could understand because its simple&lt;/P&gt;
&lt;P&gt;my log says that my SAS engine does not support it.&lt;/P&gt;
&lt;P&gt;the code without macors however works&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/**no macros**/

filename H163 'C:\Users\HP SPECTRE\Documents\meps directory\consolidated\H163.SSP';
proc xcopy in = H163 out = MEPS import;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/**macros**/
%let path = C:\Users\HP SPECTRE\OneDrive\MEPSP;
%let out = &amp;amp;path.\results;

libname MEPSP "&amp;amp;path.";

%macro imp (MYFILE);
filename &amp;amp;MYFILE. "&amp;amp;path.\&amp;amp;MYFILE..SSP";
proc xcopy in  = &amp;amp;MYFILE. out = MEPSP import;
run;
%mend imp;

%imp (H163);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;/***log for macros**/

  %LET PATH = C:\Users\HP SPECTRE\OneDrive\MEPSP;
152  %LET OUT = &amp;amp;PATH.\RESULTS;
153
154  LIBNAME MEPSP "&amp;amp;PATH.";
NOTE: Libref MEPSP was successfully assigned as follows:
      Engine:        V604
      Physical Name: C:\Users\HP SPECTRE\OneDrive\MEPSP
155
156  %MACRO IMP (MYFILE);
157  FILENAME &amp;amp;MYFILE. "&amp;amp;PATH.\&amp;amp;MYFILE..SSP";
158  PROC XCOPY IN = &amp;amp;MYFILE. OUT = MEPSP IMPORT;
159  RUN;
160  %MEND IMP;
161
162  %IMP (H163);

NOTE: Input library H163 is sequential.
NOTE: Copying H163.H163 to MEPSP.H163 (memtype=DATA).
NOTE: Libname and/or system options for compress, pointobs, data representation and encoding attributes were used at user's
      request.
ERROR: The V604 engine does not support file creation.
ERROR: File MEPSP.H163.DATA has not been saved because copy could not be completed.
NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE XCOPY used (Total process time):
      real time           0.17 seconds
      cpu time            0.14 seconds

NOTE: The SAS System stopped processing this step because of errors.


&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 08:45:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781199#M31742</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-11-19T08:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781203#M31743</link>
      <description>&lt;P&gt;You are right. I am using it for a MEPS project. They have a macro code for importing directly from their website but it didnt work for me.&lt;/P&gt;
&lt;P&gt;Possibly bacuse its quite complicated and i understand it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please find the link below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P aria-hidden="true"&gt;&lt;A href="https://github.com/HHS-AHRQ/MEPS-workshop   " target="_self"&gt;https://github.com/HHS-AHRQ/MEPS-workshop &lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/HHS-AHRQ/MEPS-workshop/blob/master/sas_exercises/Automate_Load_SAS9_Files.sas" target="_self"&gt;https://github.com/HHS-AHRQ/MEPS-workshop/blob/master/sas_exercises/Automate_Load_SAS9_Files.sas&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 08:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781203#M31743</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-11-19T08:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to import ssp file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781438#M31787</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks very much for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This worked:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = C:\Users\HP SPECTRE\OneDrive\MEPSProject;
libname MEPS_P "&amp;amp;path.";

%macro imp (MEPFILE);
filename &amp;amp;MEPFILE.  "&amp;amp;path.\RAW\&amp;amp;MEPFILE..ssp";
proc xcopy in = &amp;amp;MEPFILE. out = MEPS_P import;
run;
%mend imp;

%imp (H163);
%imp (H171);
%imp (H181);
%imp (H162);
%imp (H170);
%imp (H180);
%imp (H160a);
%imp (H168a);
%imp (H178a);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 07:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-macros-to-import-ssp-file/m-p/781438#M31787</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-11-20T07:04:24Z</dc:date>
    </item>
  </channel>
</rss>

