| Date: | Tue, 5 Feb 2008 13:39:20 -0800 |
| Reply-To: | pchoate <paulchoate61@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | pchoate <paulchoate61@GMAIL.COM> |
| Organization: | http://groups.google.com |
| Subject: | Re: How to put a table in an external file (txt-file) |
|
| Content-Type: | text/plain; charset=ISO-8859-1 |
jernspet -
I think what is happening is that your data are surpassing your
PAGESIZE. Your program is forcing a page eject after the ninth
record. Take a look at the documentation on the FILE statement.
hth
On Feb 5, 1:48 am, jernspet...@hotmail.com wrote:
> I'm utilizing a program where the input comes from a txt-file and I
> want to make an input file (txt-file) with data processed in SAS. In
> short my question is how to put a table into an external file (txt-
> file) that has a given format?
>
> I know this I quite simple, however, I need some guidance. Does
> someone have time to give me some clues?
>
> The format of the input file is mainly this:
> **** CONTROL PARAMETERS ****
>
> Simulation time 100
> Nr. iterations 10
> Yrs betw. Output 1
>
> Nr. Of records 2
> 1.0 1.0 5.0 1000.0 0.0
> 2.0 1.0 3.0 3000.0 0.0
>
> Simulation type E
>
> Option 1 E
>
> Option 2 3
>
> Option 3 1
>
> *****************************'
>
> The table below is supposed to be placed where the to data lines are
>
> Infile table
> var1 var2 var3 var4 var5
> 2.0 1.0 30.8 100.0 0.0
> 2.0 1.0 8.5 100.0 0.0
> 2.0 1.0 26.6 100.0 0.0
> 2.0 1.0 16.8 100.0 0.0
> 2.0 1.0 15.9 100.0 0.0
> 2.0 1.0 7.4 100.0 0.0
> 2.0 1.0 16.2 100.0 0.0
> 2.0 1.0 10.1 100.0 0.0
> 2.0 1.0 6.5 100.0 0.0
> 2.0 1.0 11.9 100.0 0.0
>
> However I have a small problem placing my table. In my program I have
> written:
>
> put '******* CONTROL PARAMETERS *******';
> put ' ';
> put 'SIMULATION TIME 100 ';
> put 'NR OF ITERATION 10 ';
> put 'YRS BETW OUTPUT 1 ';
> put ' ';
> put 'NR OF RECORDS 1 ';
>
> do i=1 to 10;
> THEN put @5 var1 +3 var2 +3 var3 +3 var4 +3 var5 +3 ;
> /*variable names in the table, see above. (the format is yet not
> complete)
> */
> set table;
> end;
>
> put ' Simulation type E';
> put ' ';
> put ' Option 1 E';
> put ' ';
> put ' Option 2 2';
> put ' ';
> put ' Option 3 1';
> put ' ';
>
> RUN;
>
> However my results go like shown below, where 9 rows are together and
> one row is placed alone. What do I have to do in order to also include
> the last line? I have done several attempts, changing the do-statement
> etc. do i=1 to 11 will list all rows together but exclude the put -
> lines below the table.
>
> ******* CONTROL PARAMETERS *******
>
> SIMULATION TIME 100
> NR OF ITERATION 10
> YRS BETW OUTPUT 1
>
> NR OF RECORDS 1
> 2 1 30.8 100 0
> 2 1 8.5 100 0
> 2 1 26.6 100 0
> 2 1 16.8 100 0
> 2 1 15.9 100 0
> 2 1 7.4 100 0
> 2 1 16.2 100 0
> 2 1 10.1 100 0
> 2 1 6.5 100 0
> Simulation type E
>
> Option 1 E
>
> Option 2 2
>
> Option 3 1
>
> ******* CONTROL PARAMETERS *******
>
> SIMULATION TIME 100
> NR OF ITERATION 10
> YRS BETW OUTPUT 1
>
> NR OF RECORDS 1
> 2 1 11.9 100 0
|