SHAZAM Community
Ask Your Question
0

Saving generated data

asked 2012-04-14 07:16:12 +0000

updated 2012-04-14 07:22:28 +0000

A SHAZAM User asked:

Hi all, I have generated some variables (using the GENR-command), and I wonder whether it is possible to save the variables (1) in a separate file which I can open (later) in Shazam or alternatively open the file by using for example Excel, and (2) is possible to save generated variables directly in the data-file you are using?

(question recreated)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2012-04-14 07:21:28 +0000

updated 2012-04-14 07:40:35 +0000

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
READ(C:\Temp\Variables.dat) / NAMES 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

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

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-04-14 07:16:12 +0000

Seen: 632 times

Last updated: Apr 14 '12