I would like to drop all the variables that are positioned after a given variable of my dataset. I saw that I could use the absolute position of a variable to get rid of it, for instance by using the command -tokenize-. However I'm using a loop to work on several dataset and the absolute position of a variable can vary from one dataset to another. But the variables I want to drop are always located after a certain variable called varX. So I would like to use a command to drop variables based on their relative position to varX.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str3(var1 var2 var3 varX varY varZ) "123" "222" "332" "124" "554" "777" "217" "232" "67" "12" "332" "83" end
Thank you in advance for your help.
0 Response to Dropping all the variables that are positioned after a variable.
Post a Comment