???CALL SYSTEM(" type ""&SASfold1\TOC1_1.TBL"" > ""&SASfold\Tables(&RUN_TS).TBL""");???

???CALL SYSTEM(" type ""&SASfold1\TOC1_1.TBL"" > ""&SASfold\Tables(&RUN_TS).TBL""");???

Post by Johnson Cha » Fri, 16 Nov 2001 02:26:22



Hey, every SASLer,

When i ran these program(the WHOLE LOG is below), I found, the line 9
can be executed well but the others cannot. however these lines are
very similar and i am sure all the .TBL files are accessable and fine.
How to use the function CALL SYSTEM? what the paremeters of this
function? TYPE is valid? or something I did not considered? Please
give your idea. Many thanks for your attention.

Johnson Chang

1    DATA _NULL_;
2
3    %* Combine into one file;
4    %let RUN_TS = %sysfunc(translate(%sysfunc(compress(%sysfunc(datetime(),datetime20.))),'-',':'));

5    %let SASfold1  =E:\Stats Development\Dev\Result;
6    %let SASfold2  =E:\Stats Development\Dev\Result\SHELLTABLE\;
7    %LET SASfold   =E:\Stats Development\Dev;
8
9    CALL SYSTEM(" type ""&SASfold1\TOC1_1.TBL"" >
""&SASfold\Tables(&RUN_TS).TBL""");

10   CALL SYSTEM(" type ""&SASfold1\DEMO1_1.TBL"" >>
""&SASfold\Tables(&RUN_TS).TBL""");

11   CALL SYSTEM(" type ""&SASfold2\DEMO1_1.TBL"" >>
""&SASfold\Tables(&RUN_TS).TBL""");

12   CALL SYSTEM(" type ""&SASfold2\MEDH1_1.TBL"" >>
""&SASfold\Tables(&RUN_TS).TBL""");

13
14   RUN;

NOTE: DATA statement used:
      real time           12.51 seconds

 
 
 

???CALL SYSTEM(" type ""&SASfold1\TOC1_1.TBL"" > ""&SASfold\Tables(&RUN_TS).TBL""");???

Post by Tim » Fri, 16 Nov 2001 13:37:44


I notice your second path ends in a slash, while your first path does
not.  You are constructing paths with \\ in the second case.

> Hey, every SASLer,

> When i ran these program(the WHOLE LOG is below), I found, the line 9
> can be executed well but the others cannot. however these lines are
> very similar and i am sure all the .TBL files are accessable and fine.
> How to use the function CALL SYSTEM? what the paremeters of this
> function? TYPE is valid? or something I did not considered? Please
> give your idea. Many thanks for your attention.

> Johnson Chang

> 1    DATA _NULL_;
> 2
> 3    %* Combine into one file;
> 4    %let RUN_TS = %sysfunc(translate(%sysfunc(compress(%sysfunc(datetime(),datetime20.))),'-',':'));

> 5    %let SASfold1  =E:\Stats Development\Dev\Result;
> 6    %let SASfold2  =E:\Stats Development\Dev\Result\SHELLTABLE\;
> 7    %LET SASfold   =E:\Stats Development\Dev;
> 8
> 9    CALL SYSTEM(" type ""&SASfold1\TOC1_1.TBL"" >
> ""&SASfold\Tables(&RUN_TS).TBL""");

> 10   CALL SYSTEM(" type ""&SASfold1\DEMO1_1.TBL"" >>
> ""&SASfold\Tables(&RUN_TS).TBL""");

> 11   CALL SYSTEM(" type ""&SASfold2\DEMO1_1.TBL"" >>
> ""&SASfold\Tables(&RUN_TS).TBL""");

> 12   CALL SYSTEM(" type ""&SASfold2\MEDH1_1.TBL"" >>
> ""&SASfold\Tables(&RUN_TS).TBL""");

> 13
> 14   RUN;

> NOTE: DATA statement used:
>       real time           12.51 seconds


 
 
 

???CALL SYSTEM(" type ""&SASfold1\TOC1_1.TBL"" > ""&SASfold\Tables(&RUN_TS).TBL""");???

Post by Johnson Cha » Fri, 23 Nov 2001 12:32:49


Hello,

Tim, yes i wrote a more '/', but it doesnot work even i modified it.
Now I have settled the question about CALL SYSTEM using relative path
instead of absolute path and batch submit, like this(below):

Anyway, Thanks for your attention.

Johnson Chang
*****************************************;
data _null_;
** Combine All tables into one file named from the time running this
program;

%let RUN_TS = %sysfunc(translate(%sysfunc(compress(%sysfunc(datetime(),datetime20.))),'-',':'));

**%let SASfold1  =E:\Stats Development\Dev\Result;
**%let SASfold2  =E:\Stats Development\Dev\Result\SHELLTABLE;
**%LET SASfold   =E:\Stats Development\Dev;

**This program is at E:\Stats Development\Dev\Code\SHELLTABLE;

CALL SYSTEM("type ""...\Result\TOC1_1.TBL"" >
""...\Result\Tables(&RUN_TS).TBL""");
CALL SYSTEM("type ""...\Result\ShellTable\DEMO1_1.TBL"" >>
""...\Result\Tables(&RUN_TS).TBL""");
CALL SYSTEM("type ""...\Result\ShellTable\MEDH1_1.TBL"" >>
""...\Result\Tables(&RUN_TS).TBL""");
** more and more tables**;

run;
********************************************

 
 
 

???CALL SYSTEM(" type ""&SASfold1\TOC1_1.TBL"" > ""&SASfold\Tables(&RUN_TS).TBL""");???

Post by Richard DeVenezi » Fri, 23 Nov 2001 22:21:16


Instead of repetively calling system over and over many times, you will get
better performance by writing a batch file and just running that with one
call system().  Plus it is easy to examine the batch file for incorrect
system commands your SAS program wrote.

%let sysbatch = %sysfunct(pathname(WORK))\chang.bat;

data _null_;
  file "&sysbatch";
  put "CD ...";
  put "TYPE ... > ...";
  put "TYPE ... >> ...";
  * more and more tbl appends;
  stop;
run;

call system (&sysbatch);

--
Richard DeVenezia - SAS Macros and AF Tools
http://www.devenezia.com


Quote:> Hello,

> Tim, yes i wrote a more '/', but it doesnot work even i modified it.
> Now I have settled the question about CALL SYSTEM using relative path
> instead of absolute path and batch submit, like this(below):

> Anyway, Thanks for your attention.

> Johnson Chang
> *****************************************;
> data _null_;
> ** Combine All tables into one file named from the time running this
> program;

> %let RUN_TS =

%sysfunc(translate(%sysfunc(compress(%sysfunc(datetime(),datetime20.))),'-',
':'));
Quote:

> **%let SASfold1  =E:\Stats Development\Dev\Result;
> **%let SASfold2  =E:\Stats Development\Dev\Result\SHELLTABLE;
> **%LET SASfold   =E:\Stats Development\Dev;

> **This program is at E:\Stats Development\Dev\Code\SHELLTABLE;

> CALL SYSTEM("type ""...\Result\TOC1_1.TBL"" >
> ""...\Result\Tables(&RUN_TS).TBL""");
> CALL SYSTEM("type ""...\Result\ShellTable\DEMO1_1.TBL"" >>
> ""...\Result\Tables(&RUN_TS).TBL""");
> CALL SYSTEM("type ""...\Result\ShellTable\MEDH1_1.TBL"" >>
> ""...\Result\Tables(&RUN_TS).TBL""");
> ** more and more tables**;

> run;
> ********************************************