JCL Replace Variable in Dataset with Datasetinput

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...
DoPust
Posts: 1
Joined: Tue Mar 01, 2022 12:12 pm
Skillset: JCL, REXX, PL1
Referer: Internet

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

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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.

User avatar
sergeyken
Posts: 458
Joined: Wed Jul 24, 2019 10:12 pm
Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
Referer: Internet search

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.

willy jensen
Posts: 474
Joined: Thu Mar 10, 2016 5:03 pm
Skillset: assembler rexx zOS ispf racf smf
Referer: saw it in the experts foprum thought I could help here

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.


  • Similar Topics
    Replies
    Views
    Last post