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
JCL Replace Variable in Dataset with Datasetinput
-
- 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
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.wanted to solve this with JCL
- 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
Robert Sample wrote: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.wanted to solve this with JCL
I would add: this can be done with almost any available tool, except JCL, and HTML

Javas and Pythons come and go, but JCL and SORT stay forever.
-
- 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
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.
//INPUT DD *
DELETE FROM .... WHERE .... -
// DD DISP=SHR,DSN=A1
// DD *
DAYS.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 5
- 3990
-
by sergeyken
View the latest post
Wed Jun 16, 2021 6:23 pm
-
- 1
- 1756
-
by sergeyken
View the latest post
Tue Jan 19, 2021 9:37 pm
-
- 3
- 1993
-
by jcdm
View the latest post
Thu Aug 18, 2022 1:25 pm
-
-
Replace a string with another string with different length
by Devrana » Sun Jan 19, 2025 3:23 pm » in JCL - 1
- 1630
-
by sergeyken
View the latest post
Sun Jan 19, 2025 11:07 pm
-
-
- 1
- 4412
-
by TERMEN
View the latest post
Thu Mar 04, 2021 2:29 am