There are a few solutions to this issue.
The <b>best</b> solution is to change the submission schedule of the two jobs. Submit the 2nd job first, and when it is finished (successfully), then submit the 1st job.
You can use the TYPRUN=HOLD jobcard parameter when submitting the 1st job, and when the 2nd job is completed, you can then ‘release’ the job that is on HOLD.
I believe you need to know the assigned JES number to release the held job. This can be done manually by the computer operator or if the 2nd job can obtain the JES number, execute a step (in the 2nd job) to release the held job, which does essentially what the operator would do.
The best long term solution (an the most straight forward) is to rearrange the job schedule.