editing a jcl



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

editing a jcl

Postby nn_az » Wed Oct 26, 2011 7:49 am

Hi,

I want to edit a jcl in which i have to replace a dataset with another in more than one place.

can i do it in one go rather than copying the new one in each place?
nn_az
 
Posts: 10
Joined: Tue Oct 25, 2011 10:33 am
Has thanked: 0 time
Been thanked: 0 time

Re: editing a jcl

 

Re: editing a jcl

Postby dick scherrer » Wed Oct 26, 2011 8:49 am

Hello,

If you are using the tso/ispf editor (option 2 from the primary menu or selecting from the dataset list in 3.4)
use the command --> c 'dsn1' 'dsn2' all. If you are using some other editor, you need to explain which one you are using.

Much can be learned from the online tutorial.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: editing a jcl

Postby nn_az » Wed Oct 26, 2011 9:15 am

hello dick,

This is working fine for me.i tested with small ds name.But our site standards suggests to write dataset name like this DEVL.o82201.CREDP100.TEMP.UNBNO.so i am unable to include all the command in the required space.so is there any way to increase the available space in cmd line or anyother way...

(i am asking this because i am working as a production control analyst and need to fix the failed batch jobs by replacing the datasets.)

please help.
nn_az
 
Posts: 10
Joined: Tue Oct 25, 2011 10:33 am
Has thanked: 0 time
Been thanked: 0 time

Re: editing a jcl

Postby steve-myers » Wed Oct 26, 2011 10:38 am

nn_az wrote:... But our site standards suggests to write dataset name like this DEVL.o82201.CREDP100.TEMP.UNBNO.
There are two problems with your "site standard:' You cannot use lower case characters in a dataset name, and the last character in a dataset name cannot be a period(.).

There are three possible solutions to the problem you stated.
  • You probably only need to change a small and most likely unique part of the dataset name. Just change that part.
  • Change the long string to a short, hopefully unique, short string, then change the short string to your final name.
  • This is a desperation solution, but it has worked for me in the past: use the line mode TSO EDIT command. There are no practical length restrictions in the source and new test strings in its change commad.
steve-myers
Global moderator
 
Posts: 1886
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: editing a jcl

Postby enrico-sorichetti » Wed Oct 26, 2011 11:51 am

knowing the tools of the trade is the first thing to do...
f 'somelongstring'
c * 'someotherlongstring' all


the command line will hold a 44 char dsn for the find,
unfortunately the CHANGE ALL will hold only 40 chars

but You can split the change in two
f 'first.part.'
c * 'first.changed.' all
f '.second.part'
c * '.second.changed' all


the topic is not JCL related, might be moved to the ISPF section
and the title changed to ....
how to issue commands involving long operands
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: editing a jcl

Postby BillyBoyo » Wed Oct 26, 2011 12:00 pm

Something else you might find useful is to exclude all the lines which don't meet your search criteria (you can even get the notification of the existence of an excluded line). Then you only need to do a change for the part of the datasetname that is different, but can do so in confidence that it is not going to change anything by accident.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: editing a jcl

Postby nn_az » Wed Oct 26, 2011 1:23 pm

many thanks to all experts.
nn_az
 
Posts: 10
Joined: Tue Oct 25, 2011 10:33 am
Has thanked: 0 time
Been thanked: 0 time

Re: editing a jcl

Postby BillyBoyo » Wed Oct 26, 2011 2:12 pm

Also, when if do a find for your datasetname-to-be-changed you could then do

c * new-long-datasetname


* tells the editor to use the previous find text (from either find or change).

If you don't put "all" on the end of the change but want to do them one at a time, you can


for each line. Look at RFIND and RCHANGE as well. Useful on function keys if not there already.

Or if you do one change correctly and want then to do all the rest, you can

c * * all


Full procedure might be

f datasetname-to-be-changed
c * new-long-datasetname

verify that the change is correct, fixing as necessary, then

c * * all


It is well worth checking all of this out in the online help/tutoria for the editor. Find and Change are very powerful, if you are aware of what you can do with them.

Edit: I keep forgetting to add that you could also make a little editor macro if this is a common task for you.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: editing a jcl

Postby prino » Wed Oct 26, 2011 2:41 pm

/* REXX */
"isredit macro"
from = 'a string up to 255 characters'
to   = 'another string up to 255 characters'

"isredit c x'"c2x(from)"' x'"c2x(to)"' all"

Why the c2x'es? To prevent problems with embedded '&'s and '"'s...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

Re: editing a jcl

Postby BillyBoyo » Wed Oct 26, 2011 3:09 pm

prino wrote:
[...]

Why the c2x'es? To prevent problems with embedded '&'s and '"'s...


Very nice tip Prino. Thanks, I'll remember it.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post