# Revision history [back]

Variables generated using the GENR can be saved to a file using the WRITE command.

Here is an example that uses GENR to create two simple variables of 10 observations, write them to a file, delete them from memory and read them back from the file:

* Example generating and writing variables
* - Create two simple variables of length 10
SAMPLE 1 10
GENR A=TIME(1)
GENR B=UNI(1) + A
PRINT A B

* Write variables A and B to a file
WRITE(C:\Temp\Variables.dat) A B

* Delete all the variables from memory
DELETE / ALL

* Read variables A and B back in and display them


To work with Excel please see the FAQ item on Working with Excel: http://www.econometrics.com/faq/Excel.shtml

Some further information is also contained in the question: http://community.econometrics.com/question/15/how-can-i-use-excel-spreadsheets-with-shazam

Variables generated using the GENR can be saved to a file using the WRITE command.

Here is an example that uses GENR to create two simple variables of 10 observations, write them to a file, delete them from memory and read them back from the file:

* Example generating and writing variables
* - Create two simple variables of length 10
SAMPLE sample 1 10
GENR A=TIME(1)
GENR B=UNI(1) genr A=time(1)
genr B=uni(1) + A
PRINT print A B

* Write variables A and B to a file
WRITE(C:\Temp\Variables.dat) write(C:\Temp\Variables.dat) A B

* Delete all the variables from memory
DELETE delete / ALL
all

* Read variables A and B back in and display them


To work with Excel please see the FAQ item on Working with Excel: http://www.econometrics.com/faq/Excel.shtml

Some further information is also contained in the question: http://community.econometrics.com/question/15/how-can-i-use-excel-spreadsheets-with-shazam

Variables generated using the GENR can be saved to a file using the WRITE command.

Here is an example that uses GENR to create two simple variables of 10 observations, write them to a file, delete them from memory and read them back from the file:

* Example generating and writing variables
* - Create two simple variables of length 10
sample 1 10
genr A=time(1)
genr B=uni(1) + A
print A B

* Write variables A and B to a file
write(C:\Temp\Variables.dat) A B

* Delete all the variables from memory
delete / delete/ all

* Read variables A and B back in and display them


To work with Excel please see the FAQ item on Working with Excel: http://www.econometrics.com/faq/Excel.shtml

Some further information is also contained in the question: http://community.econometrics.com/question/15/how-can-i-use-excel-spreadsheets-with-shazam

Variables generated using the GENR can be saved to a file using the WRITE command.

Here is an example that uses GENR to create two simple variables of 10 observations, write them to a file, delete them from memory and read them back from the file:

* Example generating and writing variables
* - Create two simple variables of length 10
sample 1 10
genr A=time(1)
genr B=uni(1) + A
print A B

* Write variables A and B to a file
write(C:\Temp\Variables.dat) A B

* Delete all the variables from memory
delete/ all
delete / ALL

* Read variables A and B back in and display them
them


To work with Excel please see the FAQ item on Working with Excel: http://www.econometrics.com/faq/Excel.shtml

Some further information is also contained in the question: http://community.econometrics.com/question/15/how-can-i-use-excel-spreadsheets-with-shazam

Variables generated using the GENR can be saved to a file using the WRITE command.

Here is an example that uses GENR to create two simple variables of 10 observations, write them to a file, delete them from memory and read them back from the file:

* Example generating and writing variables
* - Create two simple variables of length 10
sample 1 10
genr A=time(1)
genr B=uni(1) + A
print A B

* Write variables A and B to a file
write(C:\Temp\Variables.dat) A B

* Delete all the variables from memory
delete / ALL
all

* Read variables A and B back in and display them them



To work with Excel please see the FAQ item on Working with Excel: http://www.econometrics.com/faq/Excel.shtml

Some further information is also contained in the question: http://community.econometrics.com/question/15/how-can-i-use-excel-spreadsheets-with-shazam

Variables generated using the GENR can be saved to a file using the WRITE command.

Here is an example that uses GENR to create two simple variables of 10 observations, write them to a file, delete them from memory and read them back from the file:

* Example generating and writing variables
* - Create two simple variables of length 10
sample 1 10
genr A=time(1)
genr B=uni(1) + A
print A B

* Write variables A and B to a file
write(C:\Temp\Variables.dat) A B

* Delete all the variables from memory
delete / all

* Read variables A and B back in and display them


ener code here read(C:\Temp\Variables.dat) / names list list

To work with Excel please see the FAQ item on Working with Excel: http://www.econometrics.com/faq/Excel.shtml

Some further information is also contained in the question: http://community.econometrics.com/question/15/how-can-i-use-excel-spreadsheets-with-shazam

Variables generated using the GENR can be saved to a file using the WRITE command.

Here is an example that uses GENR to create two simple variables of 10 observations, write them to a file, delete them from memory and read them back from the file:

* Example generating and writing variables
* - Create two simple variables of length 10
sample 1 10
genr A=time(1)
genr B=uni(1) + A
print A B

* Write variables A and B to a file
write(C:\Temp\Variables.dat) A B

* Delete all the variables from memory
delete / all

* Read variables A and B back in and display them


ener code here read(C:\Temp\Variables.dat) / names list

list

To work with Excel please see the FAQ item on Working with Excel: http://www.econometrics.com/faq/Excel.shtml

Some further information is also contained in the question: http://community.econometrics.com/question/15/how-can-i-use-excel-spreadsheets-with-shazam

Variables generated using the GENR can be saved to a file using the WRITE command.

Here is an example that uses GENR to create two simple variables of 10 observations, write them to a file, delete them from memory and read them back from the file:

* Example generating and writing variables
* - Create two simple variables of length 10
sample 1 10
genr A=time(1)
genr B=uni(1) + A
print A B

* Write variables A and B to a file
write(C:\Temp\Variables.dat) A B

* Delete all the variables from memory
delete / all

* Read variables A and B back in and display them


To work with Excel please see the FAQ item on Working with Excel: http://www.econometrics.com/faq/Excel.shtml

Some further information is also contained in the question: http://community.econometrics.com/question/15/how-can-i-use-excel-spreadsheets-with-shazam

Variables generated using the GENR can be saved to a file using the WRITE command.

Here is an example that uses GENR to create two simple variables of 10 observations, write them to a file, delete them from memory and read them back from the file:

* Example generating and writing variables
* - Create two simple variables of length 10
sample 1 10
genr A=time(1)
genr B=uni(1) + A
print A B

* Write variables A and B to a file
write(C:\Temp\Variables.dat) A B

* Delete all the variables from memory
delete / all

* Read variables A and B back in and display them


To work with Excel please see the FAQ item on Working with Excel: http://www.econometrics.com/faq/Excel.shtml

Some further information is also contained in the question: http://community.econometrics.com/question/15/how-can-i-use-excel-spreadsheets-with-shazam

To append data to an existing open file use the APPEND option on the WRITE command

Variables generated using the GENR can be saved to a file using the WRITE command.

Here is an example that uses GENR to create two simple variables of 10 observations, write them to a file, delete them from memory and read them back from the file:

* Example generating and writing variables
* - Create two simple variables of length 10
sample 1 10
genr A=time(1)
genr B=uni(1) + A
print A B

* Write variables A and B to a file
write(C:\Temp\Variables.dat) A B

* Delete all the variables from memory
delete DELETE / all
ALL

* Read variables A and B back in and display them


To work with Excel please see the FAQ item on Working with Excel: http://www.econometrics.com/faq/Excel.shtml

Some further information is also contained in the question: http://community.econometrics.com/question/15/how-can-i-use-excel-spreadsheets-with-shazam

To append data to an existing open file use the APPEND option on the WRITE command

Variables generated using the GENR can be saved to a file using the WRITE command.

Here is an example that uses GENR to create two simple variables of 10 observations, write them to a file, delete them from memory and read them back from the file:

* Example generating and writing variables
* - Create two simple variables of length 10
sample SAMPLE 1 10
genr A=time(1)
genr B=uni(1) GENR A=TIME(1)
GENR B=UNI(1) + A
print PRINT A B

* Write variables A and B to a file
write(C:\Temp\Variables.dat) WRITE(C:\Temp\Variables.dat) A B

* Delete all the variables from memory
DELETE / ALL

* Read variables A and B back in and display them