How to produce the sequence of a rotate after data has been collected

The attached spec ROTATION_ORDER.QPX willproduce the sequence that a scrambled rotate was asked in after the data has been collected. You need to set up a “codingmode” questionnaire that uses a !SPECIAL,GET_DATA_CASEand the existing data file.

Make sure you have enough data columns available to store an overall counter and a value for each “question” or “group” that was rotated. The Header of this questionnaire must parallel the original header, as it should have the same Caselength, Studyname, and CaseID location. It should also have a QFF file to produce a different QFF file.

This setup assumes that there were between 10 and 99 items rotated, so that you will need 2 column fields for all of your variables.

You can either run stand-alone Survent using RandomDataGeneration to read through the entire file or write a Mentor proc that executes the Survent Qfile (see the file srvgn.spx for an example.) If you use RDG to do at least as many cases as you have in the file. If you run this through a Mentor proc, you will need to make some adjustments. See comments marked ***MENTOR*** below.

Please note that it is strongly recommended that you first backup your data file before running this procedure, as you will be changing the original data and if you assign incorrect data positions you may overwrite and LOSE data.

See the bottom portion of the file to see how to set up the rotate so that the order of the rotate is collected at the time of the original interview. This can now also be done using the {!rotate_order} compiler directive. Check the manual for more information.

>PurgeSame~Prep Compile Specs[Rotation_Order,CaseLength=800,CaseID=1.4,QFFfile=Unscramble]{!Comment    Set up a Counter. }{ Counter: 201.2  Hide !Expression,,0 }{ CaseIDx: 1.4 Hide !Variable }{!Comment  SPECIAL,GET_DATA_CASE says to only retrieve cases from the data file that are not already updated. *** MENTOR *** If you will be using this as a Mentor procedure you will need to remove the SPECIAL,GET_DATA_CASE as this cannot be executed in MENTOR }{!If X(Counter) = 0!SPECIAL,GET_DATA_CASE }{!CommentSeed variable must be the same location as the original rotation.  Look in the .chk file of the original QFF and make sure the rotate location matches.  }{ Seed:  43.10 Hide !Variable }{!CommentRepeat below needs $A set to the number of questions/groups you are rotating.  $B is the positions that will hold the order of the rotation.  In this example location 203-204 will hold a 2 digit number that is the sequence order of when the first question was asked.  An "04" means that the first question was asked fourth, so on and so on.Be careful to not add ANYTHING else into the rotate below including comments as that can cause this to not match the original number of items you were rotating, }{!Rotate,Scramble,,Seed }>Repeat $A=1,...,18; $B=203,205,...,237{!Group }{ [Counter]!Expression,,X(Counter) + 1 }{ Pos$A: $B.2!Expression,zero_fill,Counter }>Endrepeat{!Endrotate }{!Comment  The following question is only for checking or debugging. *** MENTOR ***Note, you cannot have any interviewer interaction commands (display) in the questionnaire if you will be running this through a MENTOR procedure, so the following question must be removed. }{ Okay:Rotation sequence for Case