Using the repeat= option of prt_data

The repeat option of prt_data should be used when the formatted output of the prt_data statement would, if printed, produce two or more lines of text. This is needed because data locations cannot contain multiple lines of information.


When one attempts to use prt_data with a format that would produce multiple lines, but does not use repeat=, an error is produced indicating that there is not enough room in the receiving location for the data that you are trying to place there (error #5345).


Adding the repeat= option to a prt_data statement whose print format would not produce multiple lines has no effect on the output.

When repeat= is used, the width of the prt_data’s receiving field is effectively multiplied by the repeat factor. Thus, a prt_data statement such as:

prt_data [1.10$] repeat=3 "snsns" var1 var2 var3

will put it’s data into columns 1-30 of the data file.

Repeat= is required on prt_data statements that may explicitly or implicitly produce multi-line output. Thus, if catvar is a cat question having two categories, the following statement must use repeat= in order to correctly modify the data field:

prt_data [1.20$] repeat=2 "y$2s" catvar


Example Spec:

~comment&prtrep.doc~deffive: "12345"word: "word"~prep compile[prtrep,,noquo]{catvar:Title for catvar!cat1 1 one2 2 two}~input $~cleanprt_data [1.10$] "s" fivesay [1.40$]blank [1.40$]prt_data [1.10$] repeat=2 "s" fivesay [1.40$]blank [1.40$]m [1.40$] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"prt_data [1.10$] repeat=2 "s" fivesay [1.40$]blank [1.40$]prt_data [1.10$] repeat=2 "ss" five fivesay [1.40$]blank [1.40$]prt_data [1.10$] repeat=3 "snsns" five five fivesay [1.40$]blank [1.40$]prt_data [1.10$] repeat=3 "ssnssnss" five word five word five wordsay [1.40$]blank [1.40$]prt_data [1.10$] repeat=3 "ssnssnss" "1234567" "1" "1" "1" "123" "123"say [1.40$]blank [1.40$]prt_data [1.10$] "ssnssnss" "1234567" "1" "1" "1" "123" "123"say [1.40$]blank [1.40$]m catvar = cats(1)say catvarprint "y$2s" catvarprt_data [1.20$] repeat=2 "y$2s" catvarsay [1.40$]blank [1.40$]~end