I have a global /copy member "myMember" defining DS:
I want to create varchars with the same length as that packed numeric. So I do this:
Define a constant as the length of the packed numeric, then define a varchar based on that constant.
This works, as long as the constant is global.
But if the constant is in the subprocedure instead:
Then it fails to compile with error RNF3320 "The keyword parameter is not defined; keyword is ignored" on the constant definition line.
But I don't see why this shouldn't work?
Code:
dcl-ds myDs qualified template; myNum packed(7); end-ds;
Code:
//global: /copy myMember; dcl-c fieldLen const(%len(myDs.myNum)); dcl-pr myProc; dcl-s myStr varchar(fieldLen); ... end-pr;
This works, as long as the constant is global.
But if the constant is in the subprocedure instead:
Code:
//global: /copy myMember; dcl-pr myProc; dcl-c fieldLen const(%len(myDs2.myNum)); dcl-s myStr varchar(fieldLen); ... end-pr;
But I don't see why this shouldn't work?
Comment