Example of a move program to reformat data including text pointers

The attached spec MOVE_TEXT_DATA.SPX is a move program to realign data from two different formats maintaining text pointer integrity. The typical reason you might need to use this is you were soft coding data, and made changes to the questionnaire that affected the data layout after the study was live.

Defines to Modify are as follows:

  1. INPUT is original data file name MOVET
  2. OUTPUT the new ‘moved’ data file’s name MOVEX
  3. TEXTSTART is the location of where the text data starts 201
  4. NEWTEXTPNT are the locations of where you want allthe new text pointers to be, including onesthat have not changed position.
  5. OLDTEXTPNT are the locations of where the old text pointers were
  6. Change the Copy commands to move data into the proper locations- See #### below.

You can also change the following defines:

  1. Unomment back in OUTLEN and set it to the length you now want forthe output file. Default is INPUT length.
  2. Uncomment back in OUTTEXTSTART and set it to where you now want thetext area to start in the output file. Default is where it startedin the input file.

NOTE: MAKE SURE ALL DATA LOCATIONS ARE WRITTEN AS ABSOLUTE LOCATIONS.

>Define @Input text2>Define @Output text2_m'>Define @OutLen 1000>Define @TextStart 20001'>Define @OutTextStart 501>Define @CaseIDLoc 1.4>Define @NewTextPnt 103,106,109,112,115,118,121,124,127,130 ''New Text Pointers>Define @OldTextPnt 7,10,13,16,19,22,25,28,31,34 ''Old Text Pointers''**** Do Not Change Lines in this block ************************************06/15/16 - Removed references to MPE and MPE type syntax- Removed PUTID and replaced it with CASEID= on the output statement- Increase size of temp data case to 100K- Change coding sytle to be mixed case rather than all upper case>PurgeSame>EchoDefines~Input $~Output movet.aux,ASCII,Length=40~Def Proc= MakeAux:Modify [1.20$] = ">Define @DataEnd">IfDefine @OutTextStartModify [21.5] = @OutTextStart - 1>ElseModify [21.5] = @TextStart - 1>EndifWriteCase }~Exc Proc= MakeAux~Input @Input ,NumBuf=2,Study=Old,TextLoc=@TextStart~Output @Output CaseID=@CaseIDLoc>IfDefine @OutLenLength=@Outlen>Endif~In $,Length=100000,NewBuf,Study=New>IfDefine @OutTextStartTextLoc=@OutTextStart>ElseTextLoc=@TextStart>Endif&-movet.aux~Def Proc=Reform_Text:If FirstCase ThenChooseFile "New"Next FirstChooseFile "Old"Endif>Repeat $A=@NewTextPntEraseText New![$A$$T] >EndRepeatBlank New![1-@DataEnd]''****************************************************************************''#### Change the following copy commands to move the data into the new ####''#### record. You will need at least two copy commands, one to move ####''#### the data that is in the same location as it previously was, and ####''#### and 2nd one to move the data that has a different data location. ####Copy New![1.4] = [1.4] Copy New![101.90] = [5.90] ''**** Do not change lines below this ****************************************>Repeat $A=@NewTextPnt ; &$b=@OldTextPntBlank New![$A]Modify New![$A$$T] = [$B$$T]>EndRepeatChooseFile "New"WriteCase }~Exc Proc=Reform_Text On Old>Delete movet.aux ~End

  • Move_Text_Data.spx