Hi Sethu!
You can only have a limited number of pipes and files opened at the same time. I think that the limit is 20 in nawk. To avoid this error, you have to close the pipes with the close() command once you're done with them:
"basename " filename | getline base
close...