BookmarkSubscribeRSS Feed
Maksim_Karyagin
Calcite | Level 5

I need to find my folder. And my code work as model of optimization for data in file, which exist \datafolder\Optimization\data.xlsx/ But i got problems and ERRORS. WHERE is mistakes/ Help me, please

  *Путь и библиотека;

  %let PATH = "E:\datafolder\Optimization";
  libname AGR "E:\datafolder\Optimization";
  *options noquotelenmax nosource nonotes;
  options noquotelenmax source notes;

  *Макро-переменные;

  %let CROP_FALLOW = Пар;
  %let CROP_SETASIDE = Залежь;
  %let CROP_SUGARBEET = Сахарная свёкла;
  %let CROP_SUNFLOWER = Подсолнечник;
  %let COMB_PROD = 21.85;
  %let CLUST_DIST = 10000;
  %let MAX_SEQS = 2;
  %let YEAR_ONE = 2017;
  %let NUM_YEAR = 7;
  %let INFLATION = 0.03;

  *%let NUM_FIELD = 100;
  *%let NUM_FARM = 30;
  *%let NUM_SOIL = 7;
  *%let NUM_CROP = 10;
  *%let NUM_HOLDING = 5;
  *%let NUM_PLANT = 12;
  *%let NUM_SEQ = 7;
  *%let NUM_DRUG = 5;
  *%let NUM_DEPOT = 30;

  %let INFEASIBLE = 0;
  %let ZERO = 1E-6;

  *Макросы;

  *Импорт из экселя;

  %macro agr_data_import;

    %macro dummy; 

    %mend dummy;

        %macro agro_imp(Sheet,Range);

          %macro dummy; 

           %mend dummy;

        proc import
        datafile="\\dtln-nt-sas1\datafolder\Optimization\data.xlsx"
        out=AGR.data_&Sheet dbms=xlsx replace;
        range="&Sheet$B3:&Range";
        getnames=yes;
      run;
    %mend agro_imp;

    %agro_imp(FLD,F1907);
    %agro_imp(CRP,G13);
    %agro_imp(FOC,C36);
    %agro_imp(CC1,D75);
    %agro_imp(CC2,C11);
    %agro_imp(CC3,E69);
    %agro_imp(CMB,F45);
    %agro_imp(SQN,D38);
    %agro_imp(DR1,D20);
    %agro_imp(DR2,D1126);
    %agro_imp(HST,D3811);
    %agro_imp(YLD,H2815);
    %agro_imp(LG1,D563);
    %agro_imp(LG2,C85);
    %agro_imp(LG3,E27);
    %agro_imp(CLS,D120557);
    %agro_imp(PLN,D13331);

  %mend agr_data_import;

1.png2.png4.png5.png6.png
3 REPLIES 3
Kurt_Bremser
Super User

Please post logs and code as text in the future. Nobody here has the time to waste typing your code for testing.

And post the log of the library AGR assignment.

Reeza
Super User

Was the library assigned successfully. We don't need all your code, just up to where the error occurs and the log. 

Fix errors in the order they appear.  

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1249 views
  • 0 likes
  • 3 in conversation