Sorry, but you cannot. . . You need to repeat over and over that "JCL does nothing except execute "things" ". It has no data manipulation or logic capabilities.What ever you understand the problem is exactly correct. I am not familier with other languages. So, I am trying to fulfill this request with JCL.
If anyone ever tells you need to so something "with a JCL", you need to have them clarify which "thing" they want you to use to do what is needed.
For your current request, suggest you work with someone who is familiar with writing code - if you are not (yet?) a coder, i suspect learning from the beginning will take more time than acceptable.