How to create a file that has all the text questions on one delimited data record

The attached spec TEXTLISTING.SPXis an example to create open end listing.

1)    ####,"Label1","Text of Open End","Label2","Text of Next Open End",ETC2)    ####,"Label1","Text of Open End"####,"Label2","Text of Next Open End"ETCwhere #### is the Case ID value for each caseChange the Define Study below to the study you wish to run on.Output will be called <Study>^<Outext>.Change <Numchars> to 1 to exclude blank open ends.Change <Outlength> if you have a lot of text data on a case.  You will get an error if there is more open end data on a case than this setting.Change <Pattern> to run on only the open ends that match the pattern.Set the Define OneLine to get format 1, Comment it out to get format 2>DEFINE @STUDY OPEN>DEFINE @OUTEXT  OPN>DEFINE @NUMCHARS 0>DEFINE @OUTLENGTH 500>DEFINE @PATTERN *''>DEFINE @ONELINEThe commands below are all C-Mentor Commands.  This setup uses the following 3 step process to create the printout.1)  Read the DB file and create a file called TEMP1^DCL which contains a list of all Text questions.2)  Read the file TEMP1^DCL and reformat it to be a print command for each open end and call that file TEMP1^DCX.3)  Read the data file and ampersand in TEMP1^DCX into the print  procedure to create the listing.******************************************************************************DO NOT CHANGE LINES BELOW HERE>PURGESAME>USEDB @STUDY>PRINTFILE @STUDY~^@OUTEXT ,USER,PAGEWIDTH=@OUTLENGTH >LISTDB ,TEMP1,TYPE=VAR=7,SORT=QQNUM,PATTERN=(@PATTERN)~INPUT TEMP1^DCL,ASCII=80,NUMBUF=2,STUDY=INPUT~INPUT $,NEWBUF,STUDY=OUTPT~OUTPUT TEMP1^DCX,ASCII,TRIMBLANKS~DEFINEPROCEDURE= FORMATIT:IF FIRSTCASE THENCHOOSEFILE "OUTPT"NEXTENDIFCHOOSEFILE "OUTPT"MODIFY OUTPT![1.80$] = "IF STRINGLEN(" JOIN [1.8$] JOIN ") >= @NUMCHARS THEN"WRITECASE>IFDEFINE @ONELINEMODIFY OUTPT![1.80$] = "   PRINT "",""""" JOIN [1.8$] JOIN """"",""""S"""""" " JOIN [1.8$]>ELSEMODIFY OUTPT![1.80$] = "   PRINT ""S,""""" JOIN [1.8$] JOIN """"",""""S"""""" CASE_ID " JOIN [1.8$]>ENDIFWRITECASEMODIFY OUTPT![1.80$] = "ENDIF"WRITECASE}~EXECUTE PROCEDURE= FORMATIT ON INPUT~INPUT~INPUT @STUDY>IFDEFINE @ONELINE~SET -AUTONEWLINE>ENDIF~DEFINEPROCEDURE= PRINTIT:>IFDEFINE @ONELINEPRINT "S" CASE_ID>ENDIF&TEMP1^DCX>IFDEFINE @ONELINEPRINT "N">ENDIF}~EXECUTE PROCEDURE= PRINTIT ~END

  • textlisting.spx