I need a help to create a JCL to search the current year member (I.e. RPxxxx Where xxxx denote the year 2018) in a PDS file. A new member created on every year by the yearly job which used the PDS file. Hence the member name is not fixed in PDS file I.e. suffix has been changed in every year.
We need to create a JCL which check if the current year member present or not in the PDS file. So the successor job will run successfully.
If the current year member present in the PDS file then the new job will run with RC 0000 which indicate the successor job will be triggered automatically.
If the curr year member is not present in the PDS file then the job will fail with RC 0001 which indicates the next successor job will not trigger until this job recovered successfully.
Please help me to create such JCL.
Your help much appreciated.
Thanks in advance.