BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Phil_NZ
Barite | Level 11

Hi SAS Experts,

Today I face a problem listed in the title of this post

 

I have a code to run through all files in one folder

%macro variablescalculation(File=,outf=);
/*CODE of the macro*/
%mend;
/*Replicate all files in one folder*/

filename mydir 'C:\Users\pnguyen\Desktop\New folder';
data _null_;
did = dopen('mydir');
do i = 1 to dnum(did);
  fname = scan(dread(did,i),1,'.');
  /*At this point I assign that the filename has the tail is xlsx or sas7bdat, if not, use another way
  fname= ARGENTINA_FILTERF*/
  length short_fn $29;
  short_fn= substr(fname, 1,length(fname)-8);
  /*short_fn=ARGENTINA*/

  cmd=cats('%variablescalculation(File=C:\Users\pnguyen\Desktop\New folder\',
      strip(fname),',outf=',short_fn,');');
  call execute(cmd);
end;
keep fname;
run;

I only put one file in this folder to test if the result is familiar with the result running for one file only out of macro.

I also run the code variablescalculation   outside the macro to compare. The result from the macro above and non-macro code are totally similar. 

However, there is only two things happened is regarding the code above, SAS EG showed a notice that

 
 

1.PNG

 

And there was no log being shown with a notice

 

2.PNG

It is really interesting to me because there was only three output generated by the code, how come it says 135 dataset created.

I also attach my variablescalculation macro code as below 

 

Libname input 'C:\Users\pnguyen\Desktop\New folder';

    data argentina;

    set input.argentina_filterf;

  run;


  *Set up lag variables;
  data argentinalag;
    set argentina;
    by type;
	lags7= ifn(first.type,.,lag(s7));
    /*create other lag variables here*/
    lags3= ifn(first.type,.,lag(s3));
    
	lags18= ifn(first.type,.,lag(s18));

    *log(0) in meaningless so set these obs equalling to missing;
     if n(s27,s2)=2 then if (1+s27/s2)>0 then do;
	  cf_ope_act=log(1+s27/s2);
	 end;
	 lagcf_ope_act = ifn(first.type,.,lag(cf_ope_act));
	 *equal to using call missing
	 lagcf_ope_act = lag(cf_ope_act)
	 if first.type then call missing (lagcf_ope_act);
    lags29= ifn(first.type,.,lag(s29));

	lags22= ifn(first.type,.,lag(s22));

	lags43= ifn(first.type,.,lag(s43));
   run;
   *********************;

	

     

  *Rename and ;
  data argentina_ (rename=(s2=tot_ass s3=net_sal s4=fix_ass_net s5=acc_rec_day 
                        s6=cogs s7=acc_pay s8=inv_day s9=inv_tur s10=sel_gen_adm
                        s11=ope_lea_exp s12=r_and_d s13=goodwill s14=fix_ass_gross
                        s15=inv_tot s16=ope_inc s17=tot_lia s18=investment 
                        s19=cas_div_tot s20=mtbv s21=boo_val_per_sha s22=p 
                        s23=roa s24=net_inc s25=gross_inc s26=fcf_per_sha 
                        s27=net_cf_ope_act s28=ni_bf_ext_ite s29=mar_cap
                        s30=tot_deb s31=roe s32=dep s33=pri_vola s34=acc_sta
                        s35=gdp s36=rea_int_rat s37=len_int_rat s38=tax 
                        s39=exc_rat s40=imp_over_gdp s41=inflation s42=unemployment
                        s43=gdp_per_cap s44=mar_cap_over_gdp s45=fdi)
                drop= i) ;
    set argentinalag;


	***Calculation here 
	calculation still using old var name;
  /*Total Asset turnover  */
	if n(s2,s3)=2 and s2>0 then
	tot_ass_tur=s3/s2;
  /*Fixed Asset turnover  */
	if n(s3,s4)=2 and s4 > 0 then
    fix_ass_tur=s3/s4;
  /* Day of Payable Outstandings*/
	if s6>0 and n(s7,lags7,s6)=3 then
	dpo=365*0.5*(lags7+s7)/s6;
  /*Cash Conversion Cycle aka screen 12*/
	if n(s5,s8,dpo)=3 then
	ccc= s5+s8-dpo;
	If ccc > 365 then delete;
	/* I do not use ccc= sum(dpo,s5,s8) because when using sum, it may sum up two arguments if there is 
	one missing, but if it is the case, it will not be fair, because you can not compare 
	days generated from 3 components and 2 components*/

  /*Receivables turnover*/
	if (s5 ne 0) and (s5 ne .)then
    rec_tur = 365/s5;
  /*Account Payable turnover*/
	if (dpo ne 0) and (dpo ne .) then
    acc_pay_tur = 365/dpo;
  /*Firm age = log(1+age) calculating based on BDATE*/
	SASDATE = input(BDATE,32.)+'30DEC1899'd ;
	format SASDATE yymmdd10.;
    fir_age = log(1+(2020-year(SASDATE)));
	
	/*https://communities.sas.com/t5/SAS-Programming/Converting-date-to-number-forth-and-back/m-p/715774#M221120*/
  /*Capital Intensity*/
	if n(s14,s15)=2 and (s14 + s15) ne 0 then
	cap_int = s14/(s14+s15);
  /*Profit*/
	if n(s16,s2)=2 and s2 > 0 then
	profit = s16/s2;
  /*Leverage*/
	if n(s17,s2)=2 and s2 > 0 then
    leverage = s17/s2;
  /*Tangibility*/
	if n(s4,s2)=2 and s2 > 0 then
	tangibility = s4/s2;
  /*Dividend*/
	if n(s19,s2)=2 and s2 > 0 then
    dividend = s19/s2;
  /*firm size (ln(assets)*/
	if s2 > 0 then
    firm_size = log(s2);
  /*GDP ln(GDP)*/
	if s35>0 then
	lngdp = log(s35);
  /*Market to book value aka screen 10*/
	if n(s21,s22)=2 and s21 > 0 then mar_to_boo = s22/s21;
	if (mar_to_boo < 0.01 and mar_to_boo ne .) or (mar_to_boo > 3) then delete;
  /*Sales growth*/
	if n(s3,lags3)=2 and lags3 ne 0 then
    sal_gro = (s3-lags3)/lags3*100;
  /*Gross Margin*/
    if n(s3,s6)=2 and s3 ne 0 then
    gro_mar = (s3-s6)/s3;
  /*Net profit margin = net profit/sale and net profit = net income*/
    if n(s3,s24)=2 and s3 ne 0 then
    net_pro_mar = s24/s3;
  /*Gross profit margin*/
    if n(s3,s25)=2 and s3 ne 0 then
    gro_pro_mar = s25/s3;
  /*Market value of equity*/
    if s29>0 then	
	log_mve = log(s29);
  /*Free Cash Flow- equalling one if higher than 0, 0 otherwise*/
	if s26>0 then fcf = 1;
    else fcf = 0;
  /*investment growth rate*/
	if s18>0 and lags18>0 then
	inv_gro_rat = log(s18)-log(lags18);
  /*deltacf*/
	if n(cf_ope_act,lagcf_ope_act)=2 then
    deltacf = cf_ope_act - lagcf_ope_act;
  /*logarithm of per capita GDP in US dollars*/
	if s43>0 then
    lngdp_per_cap = log(s43);
  /* Earnings*/
	if n(s28,lags29)=2 and (lags29 > 0) then
    earnings = s28/lags29;
  /*Return*/
	if n(s22,lags22)=2 and (lags22 > 0) then
	return= (s22 - lags22)/lags22; 
  /*Leverage*/
    if n(s30,s29)=2 and (s29 ne 0) then
    leverage = s30/s29;
  /*research and development*/
    if n(s3,s12)=2 and (s3 ne 0) then
    r_and_d_over_sal = s12/s3;
  /*Investment cycle*/
	if n(s32,s2)=2 and (s2 ne 0) then
	inv_cyc = s32/s2;
  /*GDP growth*/
	if n(s43,lags43)=2 and lags43 ne 0 then
    gdp_per_cap_gro = (s43 - lags43)/lags43;
  /*IFRS*/
	if s34 = "IFRS" then ifrs = 1;
    else ifrs = 0;
  run;

  proc means data=argentina_;
  run;
 

I tried to find a solution online and adjust the number of threshold to 300

 

3.PNG

but the above notice still exists

 

I am wondering if you can help me to sort it out.

 

Many thanks and warm regards.

 
 

 

 

 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

Your log is clean. I am unsure why you'd get the message "Enterprise Guide was unable to submit this job successfully".

I'd ask Tech Support about this if I were you.

Also, don't forget to save the logs as well as the programs for your PhD. 🙂

View solution in original post

7 REPLIES 7
Phil_NZ
Barite | Level 11

The interesting thing here is when I submit the code to Base SAS, Base SAS run it very smooth without any error! I am wondering why there is such a difference between the performance of SAS EG and SAS Base like that.

 

 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
ChrisNZ
Tourmaline | Level 20

Does your EG session connect to your local PC?

 

It is difficult to know what is happening without seeing your log. Change the code so it stops after a few iterations.

Phil_NZ
Barite | Level 11

Hi @ChrisNZ !

I do not know if EG session connect to my computer.

Regarding code changing, I delete a few if...then and the log shows off. It seems to be that the SAS Eg cannot deal with a long list of if...then

I mean, even I delete some if...then. SAS EG still have the notice "Enterprise Guide was unable to submit this job successfully". However, now, it shows the log

My changed code is:


/*Macro*/
%macro variablescalculation(File=,outf=);
*****Import data;
  Libname input 'C:\Users\pnguyen\Desktop\New folder';

    data &outf.;

    set input.&outf._filterf;

  run;


  *Set up lag variables;
  data &outf.lag;
    set &outf.;
    by type;
		lags7= ifn(first.type,.,lag(s7));
    /*create other lag variables here*/
    lags3= ifn(first.type,.,lag(s3));
    
	lags18= ifn(first.type,.,lag(s18));

    *log(0) in meaningless so set these obs equalling to missing;
     if n(s27,s2)=2 then if (1+s27/s2)>0 then do;
	  cf_ope_act=log(1+s27/s2);
	 end;
	 lagcf_ope_act = ifn(first.type,.,lag(cf_ope_act));
	 *equal to using call missing
	 lagcf_ope_act = lag(cf_ope_act)
	 if first.type then call missing (lagcf_ope_act);

    lags29= ifn(first.type,.,lag(s29));

	lags22= ifn(first.type,.,lag(s22));

	lags43= ifn(first.type,.,lag(s43));
   run;
   *********************;
  *Rename and ;
  data &outf._ (rename=(s2=tot_ass s3=net_sal s4=fix_ass_net s5=acc_rec_day 
                        s6=cogs s7=acc_pay s8=inv_day s9=inv_tur s10=sel_gen_adm
                        s11=ope_lea_exp s12=r_and_d s13=goodwill s14=fix_ass_gross
                        s15=inv_tot s16=ope_inc s17=tot_lia s18=investment 
                        s19=cas_div_tot s20=mtbv s21=boo_val_per_sha s22=p 
                        s23=roa s24=net_inc s25=gross_inc s26=fcf_per_sha 
                        s27=net_cf_ope_act s28=ni_bf_ext_ite s29=mar_cap
                        s30=tot_deb s31=roe s32=dep s33=pri_vola s34=acc_sta
                        s35=gdp s36=rea_int_rat s37=len_int_rat s38=tax 
                        s39=exc_rat s40=imp_over_gdp s41=inflation s42=unemployment
                        s43=gdp_per_cap s44=mar_cap_over_gdp s45=fdi)
                drop= i) ;
    set &outf.lag;


	***Calculation here 
	calculation still using old var name;
  /*Total Asset turnover  */
	if n(s2,s3)=2 and s2>0 then
	tot_ass_tur=s3/s2;
  /*Fixed Asset turnover  */
	if n(s3,s4)=2 and s4 > 0 then
    fix_ass_tur=s3/s4;
  /* Day of Payable Outstandings*/
	if s6>0 and n(s7,lags7,s6)=3 then
	dpo=365*0.5*(lags7+s7)/s6;
  /*Cash Conversion Cycle aka screen 12*/
	if n(s5,s8,dpo)=3 then
	ccc= s5+s8-dpo;
	If ccc > 365 then delete;
  run;

 /****************************************************/
  /*generate summary for each country */
    proc means data=&outf._ n nmiss mean p1 median p99 std min max skew kurt STACKODSOUTPUT;
    	ods output summary=&outf._sum;
    run;
	/*skew: skewness KURT: Kurtosis	*/

	**EXPORT summary**;
	/*https://communities.sas.com/t5/SAS-Programming/making-a-sas7bdat-file/td-p/417487*/ 
 	libname myfolder 'C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\3calculation';
 	proc copy in=work out=myfolder;
 		select &outf._sum;
 	 	run;
 	quit;

  /*Export file for each country*/
   	libname myfolder 'C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\3calculation';
 	proc copy in=work out=myfolder;
 		select &outf._;
 	 	run;
 	quit;
   
%mend;



/*Replicate all files in one folder*/

filename mydir 'C:\Users\pnguyen\Desktop\New folder';
data _null_;
did = dopen('mydir');
do i = 1 to dnum(did);
  fname = scan(dread(did,i),1,'.');
  /*At this point I assign that the filename has the tail is xlsx or sas7bdat, if not, use another way
  fname= ARGENTINA_FILTERF*/
  length short_fn $29;
  short_fn= substr(fname, 1,length(fname)-8);
  /*short_fn=ARGENTINA*/

  cmd=cats('%variablescalculation(File=C:\Users\pnguyen\Desktop\New folder\',
      strip(fname),',outf=',short_fn,');');
  call execute(cmd);
end;
keep fname;
run;

proc means data=argentina_;
run;

And the log is

 

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='10. test 1 file - Copy';
4          %LET _CLIENTPROCESSFLOWNAME='Process Flow';
5          %LET _CLIENTPROJECTPATH='C:\Users\pnguyen\OneDrive - Massey University\SAS\29_Dec_redo_all.egp';
6          %LET _CLIENTPROJECTPATHHOST='IT082760';
7          %LET _CLIENTPROJECTNAME='29_Dec_redo_all.egp';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=SVG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         %macro HTML5AccessibleGraphSupported;
15             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 %then ACCESSIBLE_GRAPH;
16         %mend;
17         FILENAME EGHTML TEMP;
18         ODS HTML5(ID=EGHTML) FILE=EGHTML
19             OPTIONS(BITMAP_MODE='INLINE')
20             %HTML5AccessibleGraphSupported
21             ENCODING='utf-8'
22             STYLE=HTMLBlue
23             NOGTITLE
24             NOGFOOTNOTE
25             GPATH=&sasworklocation
26         ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27         
28         /*Start :30th, Jan,2021
29            *Import all file
30             Rename var
31             Calcualte var
32         Reference
33         https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=ledsoptsref&docsetTarget=p09ikb01zz9knnn16y401
33       ! utyq4un.htm&locale=en
34         "Condition of calculating Lag in a datastep"
35         "compute natural logarithm (i.e., LN) in sas"
36         https://communities.sas.com/t5/SAS-Programming/Missing-values-were-generated-as-a-result-of-performing-an/m-p/715648#M221
36       ! 064
37         https://communities.sas.com/t5/SAS-Programming/Converting-date-to-number-forth-and-back/m-p/715774#M221120
38         https://communities.sas.com/t5/SAS-Programming/Exporting-the-data-from-proc-means-from-HTML-to-sas7bdat-and/m-p/716230#M2
38       ! 21314
39         */
40         
41         
42         /*Macro*/
43         %macro variablescalculation(File=,outf=);
44         *****Import data;
45           Libname input 'C:\Users\pnguyen\Desktop\New folder';
46         
47             data &outf.;
48         
49             set input.&outf._filterf;
50         
51           run;
52         
53         
54           *Set up lag variables;
2                                                          The SAS System                          16:55 Wednesday, February 3, 2021

55           data &outf.lag;
56             set &outf.;
57             by type;
58         		lags7= ifn(first.type,.,lag(s7));
59         
60         	/*https://communities.sas.com/t5/SAS-Programming/Condition-of-calculating-Lag-in-a-datastep/m-p/715520#M221015*/
61             /*create other lag variables here*/
62             lags3= ifn(first.type,.,lag(s3));
63         
64         	lags18= ifn(first.type,.,lag(s18));
65         
66             *log(0) in meaningless so set these obs equalling to missing;
67              if n(s27,s2)=2 then if (1+s27/s2)>0 then do;
68         	  cf_ope_act=log(1+s27/s2);
69         	 end;
70         	 lagcf_ope_act = ifn(first.type,.,lag(cf_ope_act));
71         	 *equal to using call missing
72         	 lagcf_ope_act = lag(cf_ope_act)
73         	 if first.type then call missing (lagcf_ope_act);
74         
75         	
76         	/*https://communities.sas.com/t5/SAS-Programming/compute-natural-logarithm-i-e-LN-in-sas/m-p/694806#M211930*/
77         
78             lags29= ifn(first.type,.,lag(s29));
79         
80         	lags22= ifn(first.type,.,lag(s22));
81         
82         	lags43= ifn(first.type,.,lag(s43));
83            run;
84            *********************;
85         
86         	
87         
88         
89         
90           *Rename and ;
91           data &outf._ (rename=(s2=tot_ass s3=net_sal s4=fix_ass_net s5=acc_rec_day
92                                 s6=cogs s7=acc_pay s8=inv_day s9=inv_tur s10=sel_gen_adm
93                                 s11=ope_lea_exp s12=r_and_d s13=goodwill s14=fix_ass_gross
94                                 s15=inv_tot s16=ope_inc s17=tot_lia s18=investment
95                                 s19=cas_div_tot s20=mtbv s21=boo_val_per_sha s22=p
96                                 s23=roa s24=net_inc s25=gross_inc s26=fcf_per_sha
97                                 s27=net_cf_ope_act s28=ni_bf_ext_ite s29=mar_cap
98                                 s30=tot_deb s31=roe s32=dep s33=pri_vola s34=acc_sta
99                                 s35=gdp s36=rea_int_rat s37=len_int_rat s38=tax
100                                s39=exc_rat s40=imp_over_gdp s41=inflation s42=unemployment
101                                s43=gdp_per_cap s44=mar_cap_over_gdp s45=fdi)
102                        drop= i) ;
103            set &outf.lag;
104        
105        
106        	***Calculation here
107        	calculation still using old var name;
108          /*Total Asset turnover  */
109        	if n(s2,s3)=2 and s2>0 then
110        	tot_ass_tur=s3/s2;
111          /*Fixed Asset turnover  */
112        	if n(s3,s4)=2 and s4 > 0 then
3                                                          The SAS System                          16:55 Wednesday, February 3, 2021

113            fix_ass_tur=s3/s4;
114          /* Day of Payable Outstandings*/
115        	if s6>0 and n(s7,lags7,s6)=3 then
116        	dpo=365*0.5*(lags7+s7)/s6;
117          /*Cash Conversion Cycle aka screen 12*/
118        	if n(s5,s8,dpo)=3 then
119        	ccc= s5+s8-dpo;
120        	If ccc > 365 then delete;
121        	/* I do not use ccc= sum(dpo,s5,s8) because when using sum, it may sum up two arguments if there is
122        	one missing, but if it is the case, it will not be fair, because you can not compare
123        	days generated from 3 components and 2 components*/
124        
125        
126          run;
127        
128         /****************************************************/
129          /*generate summary for each country */
130            proc means data=&outf._ n nmiss mean p1 median p99 std min max skew kurt STACKODSOUTPUT;
131            	ods output summary=&outf._sum;
132            run;
133        	/*skew: skewness KURT: Kurtosis	*/
134        
135        	**EXPORT summary**;
136        	/*https://communities.sas.com/t5/SAS-Programming/making-a-sas7bdat-file/td-p/417487*/
137         	libname myfolder 'C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\3calculation';
138         	proc copy in=work out=myfolder;
139         		select &outf._sum;
140         	 	run;
141         	quit;
142        
143          /*Export file for each country*/
144           	libname myfolder 'C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\3calculation';
145         	proc copy in=work out=myfolder;
146         		select &outf._;
147         	 	run;
148         	quit;
149        
150        %mend;
151        
152        
153        
154        /*Replicate all files in one folder*/
155        
156        filename mydir 'C:\Users\pnguyen\Desktop\New folder';
157        data _null_;
158        did = dopen('mydir');
159        do i = 1 to dnum(did);
160          fname = scan(dread(did,i),1,'.');
161          /*At this point I assign that the filename has the tail is xlsx or sas7bdat, if not, use another way
162          fname= ARGENTINA_FILTERF*/
163          length short_fn $29;
164          short_fn= substr(fname, 1,length(fname)-8);
165          /*short_fn=ARGENTINA*/
166        
167          cmd=cats('%variablescalculation(File=C:\Users\pnguyen\Desktop\New folder\',
168              strip(fname),',outf=',short_fn,');');
169          call execute(cmd);
170        end;
4                                                          The SAS System                          16:55 Wednesday, February 3, 2021

171        keep fname;
172        run;

NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

NOTE: CALL EXECUTE generated line.
1         + *****Import data;   Libname input 'C:\Users\pnguyen\Desktop\New folder';
NOTE: Libref INPUT was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\pnguyen\Desktop\New folder
1         +                                                                               data argentina;      set 
input.argentina_filterf;    run;     *Set up lag variables;   data argentinalag;     set argentina;     by type;   lags7= 
ifn(first.type,.,lag(s7));
NOTE: There were 1300 observations read from the data set INPUT.ARGENTINA_FILTERF.
NOTE: The data set WORK.ARGENTINA has 1300 observations and 70 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

2         +          lags3= ifn(first.type,.,lag(s3));       lags18= ifn(first.type,.,lag(s18));      *log(0) in meaningless so set 
these obs equalling to missing;      if n(s27,s2)=2 then if (1+s27/s2)>0 then do;    cf_ope_act=log(1+s27/s2);   end;   
lagcf_ope_act
3         + = ifn(first.type,.,lag(cf_ope_act));   *equal to using call missing   lagcf_ope_act = lag(cf_ope_act)   if first.type 
then call missing (lagcf_ope_act);               lags29= ifn(first.type,.,lag(s29));   lags22= ifn(first.type,.,lag(s22));   
lags43= ifn
4         +(first.type,.,lag(s43));    run;

NOTE: There were 1300 observations read from the data set WORK.ARGENTINA.
NOTE: The data set WORK.ARGENTINALAG has 1300 observations and 78 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

4         +                                    *********************;              *Rename and ;
4         +                                                                                        data argentina_ 
(rename=(s2=tot_ass s3=net_sal s4=fix_ass_net s5=acc_rec_day                          s6=cogs s7=acc_pay s8=inv_day s9=inv_tur 
s10=sel_gen_adm
5         +                s11=ope_lea_exp s12=r_and_d s13=goodwill s14=fix_ass_gross                         s15=inv_tot 
s16=ope_inc s17=tot_lia s18=investment                          s19=cas_div_tot s20=mtbv s21=boo_val_per_sha s22=p
6         + s23=roa s24=net_inc s25=gross_inc s26=fcf_per_sha                          s27=net_cf_ope_act s28=ni_bf_ext_ite 
s29=mar_cap                         s30=tot_deb s31=roe s32=dep s33=pri_vola s34=acc_sta                         s35=gdp 
s36=rea_int_rat
7         + s37=len_int_rat s38=tax                          s39=exc_rat s40=imp_over_gdp s41=inflation s42=unemployment            
             s43=gdp_per_cap s44=mar_cap_over_gdp s45=fdi)                 drop= i) ;     set argentinalag;    ***Calculation here
8         + calculation still using old var name;     if n(s2,s3)=2 and s2>0 then  tot_ass_tur=s3/s2;     if n(s3,s4)=2 and s4 > 0 
then     fix_ass_tur=s3/s4;     if s6>0 and n(s7,lags7,s6)=3 then  dpo=365*0.5*(lags7+s7)/s6;     if n(s5,s8,dpo)=3 then  ccc=
9         + s5+s8-dpo;  If ccc > 365 then delete;        run;

NOTE: There were 1300 observations read from the data set WORK.ARGENTINALAG.
NOTE: The data set WORK.ARGENTINA_ has 1264 observations and 81 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
5                                                          The SAS System                          16:55 Wednesday, February 3, 2021

      

9         +                                                             proc means data=argentina_ n nmiss mean p1 median p99 std 
min max skew kurt STACKODSOUTPUT;      ods output summary=argentina_sum;     run;     **EXPORT summary**;      libname myfolder
NOTE: The data set WORK.ARGENTINA_SUM has 55 observations and 12 variables.
NOTE: There were 1264 observations read from the data set WORK.ARGENTINA_.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.09 seconds
      cpu time            0.10 seconds
      

10        + 'C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\3calculation';
NOTE: Libref MYFOLDER was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\3calculation
10        +                                                                             proc copy in=work out=myfolder;    select 
argentina_sum;     run;   quit;         libname myfolder 'C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\3calculation';
NOTE: Copying WORK.ARGENTINA_SUM to MYFOLDER.ARGENTINA_SUM (memtype=DATA).
NOTE: There were 55 observations read from the data set WORK.ARGENTINA_SUM.
NOTE: The data set MYFOLDER.ARGENTINA_SUM has 55 observations and 12 variables.
NOTE: PROCEDURE COPY used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

NOTE: Libref MYFOLDER was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\3calculation
11        + proc copy in=work out=myfolder;    select argentina_;     run;

NOTE: Copying WORK.ARGENTINA_ to MYFOLDER.ARGENTINA_ (memtype=DATA).
NOTE: There were 1264 observations read from the data set WORK.ARGENTINA_.
NOTE: The data set MYFOLDER.ARGENTINA_ has 1264 observations and 81 variables.
NOTE: PROCEDURE COPY used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      
11        +                                                                  quit;;

173        
174        proc means data=argentina_;
175        run;

NOTE: There were 1264 observations read from the data set WORK.ARGENTINA_.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.10 seconds
      cpu time            0.10 seconds
      

176        
177        %LET _CLIENTTASKLABEL=;
178        %LET _CLIENTPROCESSFLOWNAME=;
179        %LET _CLIENTPROJECTPATH=;
180        %LET _CLIENTPROJECTPATHHOST=;
181        %LET _CLIENTPROJECTNAME=;
182        %LET _SASPROGRAMFILE=;
183        %LET _SASPROGRAMFILEHOST=;
184        
6                                                          The SAS System                          16:55 Wednesday, February 3, 2021

185        ;*';*";*/;quit;run;
186        ODS _ALL_ CLOSE;
187        
188        
189        QUIT; RUN;

Many thanks and warmest regards!

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
ChrisNZ
Tourmaline | Level 20

Your log is clean. I am unsure why you'd get the message "Enterprise Guide was unable to submit this job successfully".

I'd ask Tech Support about this if I were you.

Also, don't forget to save the logs as well as the programs for your PhD. 🙂

andreas_lds
Jade | Level 19

Is the directory "C:\Users\pnguyen\OneDrive - Massey University" local or automatically synced with onedrive? Maybe the network traffic causes some unexpected trouble, you should contact SAS Tech Support.

ChrisNZ
Tourmaline | Level 20

You don't check the file extension. Do you expect XLSX files as per the comment? This code should only read SAS7BDAT files.

Phil_NZ
Barite | Level 11

Hi @ChrisNZ !

 

Thank you for your point, but all input is under sas7bdat type, so I think it is not the reason about xlsx then

 

 

Many thanks!

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 2775 views
  • 3 likes
  • 3 in conversation