Pass variable to awk command search string

I must have forgot how to do this, but, I am attempting to enter a variable into an awk / gawk search pattern.

I am getting a value from user input to place in a specific section of a 132 character string.

my default command is ....

gawk --re-interval '/^([ST].{3}P .{4}CYA.{8}1)/'  ${Arch_Dir}/${CYCLE}/${SUB_NAME} | wc -l

The above command does return information as expected, but ... the

"CY" characters are the two I want to substitute based on user input.

gawk -v val="$VAL" --re-interval .....

I have attempted to pass in my value via "-v", but I must have the syntax wrong.

Any help would be greatly appreciated!

Stu

what is this suppose to do... '/^([ST].{3}P .{4}CYA.{8}1)/' , I see a match but then what?

Can you close and reopen the awk around the variable?

gawk --re-interval '/^([ST].{3}P .{4}'$VAL'A.{8}1)/'  ${Arch_Dir}/${CYCLE}/${SUB_NAME} | wc -l

Scott,

Thanks for helping me remember ! I am now able to evaluate each row of a file using different patterns with a specific input value placed anywhere in that 132 character string.

Stu