Desktop productivity for business analysts and programmers

Can't find directory. File doesn't exist

Reply
Occasional Contributor
Posts: 10

Can't find directory. File doesn't exist

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
Occasional Contributor
Posts: 10

Re: Can't find directory. File doesn't exist


3.png
Super User
Posts: 7,421

Re: Can't find directory. File doesn't exist

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 19,064

Re: Can't find directory. File doesn't exist

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.  

Ask a Question
Discussion stats
  • 3 replies
  • 168 views
  • 0 likes
  • 3 in conversation