Page 1 of 1

JCL Replace Variable in Dataset with Datasetinput

PostPosted: Wed Mar 02, 2022 12:10 pm
by DoPust
Hello together,

1. I have a Job which uses a SQL on a system A. The result is a number. Like 10. It saves this number to a central Dataset A1.
2. The second Job now also uses an SQL. It looks like : DELETE FROM .... WHERE .... - [NUMBER] DAYS. The [NUMBER] should be the value from Dataset A1.

Can anyone help me how to solve this? I wanted to try something with sort, but dont know how this works with an A1 - Dataset. I could have a solution with a REXX-Programm, but wanted to solve this with JCL.Can anyone help me?


Kind regards
Dominik

Re: JCL Replace Variable in Dataset with Datasetinput

PostPosted: Wed Mar 02, 2022 7:51 pm
by Robert Sample
wanted to solve this with JCL
You will not solve this with JCL. JCL sets up environments and executes programs -- that is all it does. You might be able to do this with SORT or REXX but neither SORT nor REXX is JCL.

Re: JCL Replace Variable in Dataset with Datasetinput

PostPosted: Thu Mar 03, 2022 7:31 pm
by sergeyken
Robert Sample wrote:
wanted to solve this with JCL
You will not solve this with JCL. JCL sets up environments and executes programs -- that is all it does. You might be able to do this with SORT or REXX but neither SORT nor REXX is JCL.

I would add: this can be done with almost any available tool, except JCL, and HTML :mrgreen:

Re: JCL Replace Variable in Dataset with Datasetinput

PostPosted: Fri Mar 04, 2022 12:50 pm
by willy jensen
if you could generate the number with a continuation character then JCL like this will do the trick:

//INPUT DD *
DELETE FROM .... WHERE .... -
// DD DISP=SHR,DSN=A1
// DD *
DAYS.