Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need to do selective update in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need to do selective update in JCL
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Sep 07, 2015 4:59 pm    Post subject: Reply to: Need to do selective update in JCL
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts 2 vsam file compare and update a fiel... ABINAYATHULASI DFSORT/ICETOOL 6 Sun May 29, 2016 11:15 am
No new posts Update the Sortout file with record c... karthik_sripal SYNCSORT 8 Tue May 17, 2016 8:52 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us