Resources

Problem regarding using dataloop

0

Hi I am trying manipulate a gauss data set using dataloop statement.

I am trying to follow the commands listed in the user guide/help file.

It does not seem to be working. Is thare any additional step that I need to follow in order for the dataloop to work?

Below is my code. I would appreciate your help in this regard.

dataset = "testnout"; //Here testnout is a gauss dataset

dataloop ^dataset datasetV2;

make hhsize2 = 1 + 0;

keep hhsize2;
endata;

The error message is saying "Operand missing" and "syntax error" pointing to the line "dataloop ^dataset datasetV2;".

Thanks and Regards.

Annesha

asked May 12, 2014

3 Answers

0

You need to turn on Dataloop Translation before you can use these commands. From the main GAUSS menu, select Tools->Preferences->Compile Options. Then you will see a checkbox (or radio button depending upon platform) next to "Dataloop Translation". Click this to turn Dataloop Translation on.

You will want to turn it back off when you are not using it.

aptech
342
0

Hello,

I was just wondering whether there is any limit on the number of cases and variables that can be used with the dataloop command.

I used it successfully to manipulate a gauss data file of 1000 rows and 6 columns.

But now I have been trying to use it with a gauss data file that has 1506 rows and 12 columns using the following command. But it seems that its been going on forever and gauss is ultimately not responding each time I am trying to run the code.

dataset1 = "DataDUST";

/*Use data loop to get only the rows that are valid*/
dataloop ^dataset1 dataset;
select not((PairID .== 355002) .and (Gender .== 1) .and (Day .== 1));
keep PairID Gender MealDurAtHome MealDurOutHome WorkDurAtHome WorkDurOutHome SocialDurAtHome SocialDurOutHome HHChoresBoth ShoppingBoth LeisureBoth Day;
endata;

All that I need to do is to create some new variables and put it back into a gauss data set or delete some rows and create a new data set from the old one.

I would appreciate your help in this regard.

Thanks and Regards

Annesha

 

0

There are not any size limitations to dataloop translations. However, prior to GAUSS 14, dataloop translation did not support variable names greater than 8 characters. This is likely the problem.

I think it will be much simpler for you to simply load the data from the dataset with the GAUSS loadd command, delete rows using logical comparisons (i.e. .&lt, .==, .>, etc) and the GAUSS delif function, then resave the dataset with saved.

aptech
342