HOW TO IMPORT MULTIPLE EXCEL SHEETS INTO SAS

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 8

  • @Mgilsy
    @Mgilsy 3 года назад

    What a great video. Thank you, sir.

  • @kzu8976
    @kzu8976 3 года назад

    your input parameter can be a list. then %scan them to retrieve each list element (sheet name), instead of calling your macro 4 times

    • @gerrabosco4034
      @gerrabosco4034 3 года назад

      Could you please explain? Is there also a way to then put the sheet names into a column? Thank you!

    • @kzu8976
      @kzu8976 3 года назад

      @@gerrabosco4034 I was talking about a simple loop.something like this : (pseudo code, for different files. for sheet names, you can change the proc import part )
      %macro customizedimport(filelist);
      let num = 1;
      filename = %scan(filelist, num);
      proc sql; (create a table that will contain all input file names)
      create table filenames as ......
      quit;
      %do %while(&filename ne )
      1. proc import datafile = filename out= out&num ...... (output imported excel dataset to out1, out2 etc.)
      2. proc sql; ( append filename into the table "filenames");
      num = %eval(num + 1);
      filename = %scan(filelist, num);
      %end;
      %mend
      then you can call it like this:
      %customizedimport( %str( filename1 filename2 filename3));

  • @난바로키스해요-d3d
    @난바로키스해요-d3d 5 лет назад

    thank you so much!!! really helpful

  • @wilddoge2737
    @wilddoge2737 4 года назад

    Hi!
    Do you know a trick to import two or more SAS tables in a single excel sheet?

  • @samuelTTekle
    @samuelTTekle Год назад +1

    The problem is when you have 1000 sheets.