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

JCL to make changes in othe JCL's


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ziddiguy

New User


Joined: 20 Jul 2007
Posts: 14
Location: Germany

PostPosted: Sat May 24, 2008 2:10 pm
Reply with quote

Hello Everybody,

I have a PDS with thousand members(JCL), now i want to add a steplib in all 1000 members which has IKJEFT01 as the program name, around all 1000 members has 2 steps of IKJEFT01 and I also want to add a proc name before all steps
e.g. //SYSOUT DD *
//PROCNAME.SYSOUT DD *

Could some one tell me how can i do it using IBM utilities as I don't want to use REXX
Thanks in advance
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Sat May 24, 2008 3:21 pm
Reply with quote

Quote:
Could some one tell me how can i do it using IBM utilities as I don't want to use REXX

Is there any good reason why you would not want to use the easiest solution available ?
Back to top
View user's profile Send private message
ziddiguy

New User


Joined: 20 Jul 2007
Posts: 14
Location: Germany

PostPosted: Sat May 24, 2008 3:34 pm
Reply with quote

Thanks for your reply

The reason is that I don't know REXX and I am trying to find the solution through IBM Utilities only if its feasible

I am sure and confident that the moderators and users of this forum are amazing and would give me the best solution

Thanks
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Sat May 24, 2008 4:42 pm
Reply with quote

Here's a post from earlier .................. hope it helps you out.

Where it says "ISREDIT COPY member BEFORE "CRSLINE
member is a member in the base PDS that is being edited.

I don't usually post too much code these days, but having already done something very similar ..... If I have the code and it can be changed in seconds then I am happy to post. ..... Just amended my current version, and have Not tested it

Obviously in batch you will need to allocate all of the required ISPF libraries.

1) Main REXX EXEC
Code:

 /* REXX *** LIST PDS AND INVOKE EDIT MACRO TO UPDATE MEMBERS         */
                                                                       
 Address Ispexec "Control Errors Return"                               
 Pds = "pds name"
 mac = 'UPDATPD1'
 x = msg('off')
 x=outtrap(list.)
 "LISTDS '"Pds"' MEM "
 x=outtrap(off)
 Do aa = 7 to list.0
  "Ispexec edit dataset('"Pds"("Strip(list.aa)")') MACRO("mac")" 
 End                           


The Macro
Code:
 
/* REXX *** ISPF EDIT MACRO      */ 
Address Ispexec "Control Errors Return"
"ISREDIT MACRO"
"ISREDIT F 'PGM=NOB' FIRST"
Rcx = RC
"ISREDIT F 'PGM=NEM' FIRST"
Rcy = RC                                 
If Rcx = 0 & Rcy = 4 then do             
  "ISREDIT F 'PGM=' LAST"               
  "ISREDIT (CRSLINE) = " CURSOR         
  "ISREDIT COPY member BEFORE "CRSLINE   
End                                     
Back to top
View user's profile Send private message
ziddiguy

New User


Joined: 20 Jul 2007
Posts: 14
Location: Germany

PostPosted: Sun May 25, 2008 12:34 am
Reply with quote

Thanks a lot for the reply

But I really didn't understand much as i had told i don't know much REXX
icon_sad.gif icon_sad.gif

I just want to confirm that is it possible to use utilities like IEBUPDTE and some other in JCL to get the same task done

Thanks a lot
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sun May 25, 2008 1:04 am
Reply with quote

Hello,

What programming languages do you know?

You could use a combination of utilities and some of your own code to do what you want. You could unload the pds. Make changes via code. Then reload the pds.

Whatever you do, you want to make a backup before you begin.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun May 25, 2008 3:43 am
Reply with quote

If you have FileAid at your shop, you can try this:
Code:
//INSRTLN  JOB (888),'INSRTLN',CLASS=C,MSGCLASS=X,
//       NOTIFY=XXX
//*
//STEP01 EXEC PGM=FILEAID
//DD01     DD DISP=SHR,DSN=yrjcllib
//NEWDSN   DD DISP=SHR,DSN=newjcllib
//SYSPRINT DD SYSOUT=*
//SYSLIST  DD SYSOUT=*
//SYSIN    DD *
$$DD01 USER F=JCL,WRITE=NEWDSN,
            IF=(1,20,C' EXEC '),
           you may want to change 20 to a larger # - I used this to ID job card
            MOVE=(1,80C' '),
            MOVE=(1,C'// JCLLIB ORDER=(PA.BASE.PROCLIB)'),
            chang the above stmt to your needs
            WRITE=NEWDSN
Back to top
View user's profile Send private message
ozgurseyrek

New User


Joined: 22 Feb 2008
Posts: 70
Location: Turkey

PostPosted: Thu Nov 12, 2009 8:35 pm
Reply with quote

I have rafined the rexx and macro but It takes error;
Code:
/* REXX *** LIST PDS AND INVOKE EDIT MACRO TO UPDATE MEMBERS         */
Pds = 'SHR.XXXXX.YYYYY'                                                 
mac = 'MASSUPDT'                                                       
x = msg('off')                                                         
x=outtrap(list.)                                                       
"LISTDS '"Pds"' MEM "                                                   
x=outtrap(off)                                                         
Do aa = 7 to list.0                                                     
 "Ispexec edit dataset('"Pds!!"("!!Strip(list.aa)!!")') MACRO("mac")"   
End                                                                     


MASSUPDT MACRO;
Code:
/* REXX *** ISPF EDIT MACRO      */                 
Address Ispexec "Control Errors Return"             
"ISREDIT C 'test string' 'test replace' all"         
End                                                 


THE ERROR:

Code:
     6 +++                                                                     
     4 +++ x = msg('off')                                                     
IRX0013I Error running LISTUPDT, line 6: Invalid character in program         
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Nov 12, 2009 8:44 pm
Reply with quote

You can remove that line and see what happens, it isn't a required line.

Also I think that you forgot to include in the macro
"ISREDIT MACRO"

The code shown will also need as the last line
"ISREDIT END"

Sorry, I'd forgotten that
Back to top
View user's profile Send private message
ozgurseyrek

New User


Joined: 22 Feb 2008
Posts: 70
Location: Turkey

PostPosted: Fri Nov 13, 2009 12:56 am
Reply with quote

Hi expat,
I have write a rexx and a macro, Rexx works but doesn't call macro?
Also macro is a member at the rexx library with my rexx.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Nov 13, 2009 12:22 pm
Reply with quote

Take a look at the ALTLIB statement in the manuals or google, and it will work once you define your own library.
Back to top
View user's profile Send private message
ozgurseyrek

New User


Joined: 22 Feb 2008
Posts: 70
Location: Turkey

PostPosted: Fri Nov 13, 2009 3:30 pm
Reply with quote

I Couldn't run Rexx, something is wrong but I don't know what...

For testing I have write a simple rexx but it doesnt't work;

member XXX.YYY.CLIB(TESTR)
Code:
 /* REXX *** LIST PDS AND INVOKE EDIT MACRO TO UPDATE MEMBERS         */
Say 'Hello World1'
  ÜIspexec edit dataset(SHR.XXX.YYYY(MEMBER1)) MACRO(TESTM)Ü                                                                   


member XXX.YYY.CLIB(TESTM)
Code:
 /* REXX *** LIST PDS AND INVOKE EDIT MACRO TO UPDATE MEMBERS         */
  Say 'Hello World2'                                                     


At the output Only "Hello World1" printing.
I could't achieve call TESTM rexx member in TESTR rexx member.

Please help...
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Nov 13, 2009 4:00 pm
Reply with quote

Try using this instead .......... with ALTLIB
Code:
/* REXX *** LIST PDS AND INVOKE EDIT MACRO TO UPDATE MEMBERS         */
"ALTLIB ACTIVATE APPL(EXEC) DA('Your REXX library')"   
Say 'Hello World1'
"Ispexec edit dataset(SHR.XXX.YYYY(MEMBER1)) MACRO(TESTM)"
"ALTLIB DEACTIVATE APPL(EXEC) "
Back to top
View user's profile Send private message
ozgurseyrek

New User


Joined: 22 Feb 2008
Posts: 70
Location: Turkey

PostPosted: Fri Nov 13, 2009 4:38 pm
Reply with quote

It didn't work icon_sad.gif

Are there any problem in my JCL that calls that Rexx?

Code:
//* REXX for MASS Update on A PDS                                     
/*                                                                     
//REXX     EXEC PGM=IKJEFT01,DYNAMNBR=30,REGION=4096K,PARM='TESTR' 
//SYSEXEC  DD   DSN=XXX.YYY.CLIB,DISP=SHR                             
//SYSPROC  DD   DSN=XXX.YYY.CLIB,DISP=SHR                             
//SYSTSPRT DD   SYSOUT=*                                               
//SYSPRINT DD   SYSOUT=*                                               
//SYSTSIN  DD   *                                                     
/*                                                                     
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Nov 13, 2009 5:13 pm
Reply with quote

Yes, you are executing basic TSO in batch. You will need to add the relevant ISPF DD names and libraries into your batch job to enable it to work.

There are many topics on running ISPF in batch on the forum / internet.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts trying to make sense of keylists TSO/ISPF 11
No new posts Make cobol variable value a variable COBOL Programming 3
No new posts Single COPY CICS TS datasets and when... CICS 2
No new posts DFSORT VB File make 2 lines from 1 DFSORT/ICETOOL 2
No new posts How to make REXX process different GDGs? CLIST & REXX 15
Search our Forums:

Back to Top