Use of *n in free format RPG

Viewed 55

So, I have got a job where fully free format RPG is used (even the D-Specs are in free).

I am confused about the use of "*N" in various declarations. Like in data structures, procedure prototypes etc.

My general understanding is that it is used as some sort of a placeholder when declarations without a name is defined.

Can someone help in understanding this?

2 Answers

That's exactly right. *N indicates "no name". In free-form, you can't just omit the name completely the way you can in fixed-form, so *N is used as a place-holder. You use this for subfields, prototype-parameters, procedure interfaces, and unqualified data structures.

check out this recent question

RPG allows you overlay an array over the same memory location of other subfields in the same data struct. You declare nameless subfields in a data struct and give them initialize values. Then overlay the array over those sub fields, making those sub fields items in the array.

Related