With PATHCOPY and a repeating element (at least Segment and Field – I have not tried Group) if there is a Repetition position specified the tokenizer/parser expects either an absolute value or a % reference.
But if you leave off the repetition position then PATHCOPY has a feature where it will COPY all elements of all repetitions at that level – unless the variants don’t match up or unless PATHCOPYing from one node to another (like Group to segment or one segment to a different type of segment).
It is just the way PATHCOPY was written.
I suggest you add comments so the next person (or even you later on) who works on this section of code doesn’t have to remember this non-obvious feature.
Personally I don’t use PATHCOPY in this way just because I like the control of specifying the ITERATE and the self documenting that presents. Just a personal preference.
This is one of the topics I cover in my Xlate ITERATE Class.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.