IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to do selective update in JCL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manuwankenobi

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Mon Sep 07, 2015 4:23 pm
Reply with quote

Hi all,

I have to replace the program name in steps from JCL, but only if I find some data later.
For example I want to replace OLPGM by NEWPGM only if I found the string "PARM0001" somewhere later in the step.

Input file :
Code:

//S1 EXEC PGM=OLDPGM
//...
//...
//...
//SYSIN DD *
  PARM0001
//S2 EXEC PGM=OTHERPGM
//...
//...
//...
//SYSIN DD *
  PARM0015
//S3 EXEC PGM=OLDPGM
//...
//...
//...
//SYSIN DD *
  PARM0002
.....


Expected ouput file :
Code:

//S1 EXEC PGM=NEWPGM
//...
//...
//...
//SYSIN DD *
  PARM0001
//S2 EXEC PGM=OTHERPGM
//...
//...
//...
//SYSIN DD *
  PARM0015
//S3 EXEC PGM=OLDPGM
//...
//...
//...
//SYSIN DD *
  PARM0002
........


Do you think that there is a simple way to achieve this with DFSORT, I so could you give me an idea on how to to this ?

Thank you.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Sep 07, 2015 4:59 pm
Reply with quote

You have one piece of JCL you want to do this to, or a library full?

If the latter, a general-purpose programming language would be a better choice. Probably.

Is the value you are looking for only in data-cards (and only data-cards which don't begin with //)?

A JOINKEYS using the same dataset for both inputs.

In JNF1CNTL, use WHEN=INIT to PARSE by "word" (for the first two) and use WHEN=GROUP to PUSH a sequence number when the second PARSEd field is EXEC and the first begins with // and doesn't have an * in column three.

In JNF2CNTL, OMIT COND= for "//b" (where b is blank) and "//*. Do the same PARSE and GROUP as above and then use WHEN=(logicalexpression) to clobber the SEQ for any card which begins //. Another WHEN=(logicalexpression) to clobber any which does not contain your value (you can use SS, perhaps PARSE, unless your positions and lengths are rigorous).

JOINKEYS to specify SORTED and NOSEQCK.

JOIN UNPAIRED,F1

REFORMAT to contain F1 and the matched-marker.

In the main task, you'll need to PARSE to find the EXEC card and make the change.

Two hits of your value in the same data will mess things up.

You need to watch for JCL comments, JECL and even for /* cards where someone has added text to it. Also check for possibility of value appearing in DSN, or other information relating to JCL cards.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Read a flat file and update DB2 table JCL & VSAM 2
No new posts how to update an ISR appl var from an... TSO/ISPF 8
No new posts Selective extract of multi-record-typ... SYNCSORT 4
No new posts DB2 SQL query to read and update data... DB2 12
No new posts SKIP LOCKED DATA in UPDATE statement DB2 9
Search our Forums:

Back to Top