JCL Replace Variable in Dataset with Datasetinput



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

JCL Replace Variable in Dataset with Datasetinput

Postby DoPust » Wed Mar 02, 2022 12:10 pm

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
DoPust
 
Posts: 1
Joined: Tue Mar 01, 2022 12:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL Replace Variable in Dataset with Datasetinput

Postby Robert Sample » Wed Mar 02, 2022 7:51 pm

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.
Robert Sample
Global moderator
 
Posts: 3693
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 275 times

Re: JCL Replace Variable in Dataset with Datasetinput

Postby sergeyken » Thu Mar 03, 2022 7:31 pm

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:
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 315
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 5 times
Been thanked: 30 times

Re: JCL Replace Variable in Dataset with Datasetinput

Postby willy jensen » Fri Mar 04, 2022 12:50 pm

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.
willy jensen
 
Posts: 397
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 57 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post