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
 

 

Jobname same as Member name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
mubashir.surury

New User


Joined: 29 Sep 2005
Posts: 23
Location: Pune

PostPosted: Tue Jan 30, 2007 12:27 pm    Post subject: Jobname same as Member name
Reply with quote

Hi Everyone,

I have a PDS with member containing JCL's.My reqquirement is to that I need the Jobname(in Jobcard) to be same as the Member name in which it exists.the member list is dynamic and has to be fetched on the run time.
Can you tell me whether this can be done and if yes can you give me the Logic as to how it can be done.My doubt is how can I read all the members 1 by 1 and edit them on my way.

Regards,
Mubashir.
A ship in harbor is safe; but that is not what ships are built for
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Jan 30, 2007 2:06 pm    Post subject:
Reply with quote

REXX might be a great solution.
First, you need to read the members, and you can do that using:
1. LISTDS command, and OUTTRAP the output.
2. LMMLIST service of ISPF.
3. Read the PDS directory.

Then, for each member issue the ISPF service EDIT, with the MACRO parameter.

Create an edit macro that retrieves the member name using the MEMBER command, and then read the JOB card using LINE commands.

O.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Wed Jan 31, 2007 1:29 am    Post subject:
Reply with quote

Hello,

What process creates the dynamic jcl members? Might that process be modified so that when a new member is created, it has the correct jobname in it? If that is done, there would be no need to put the correct jobname in later.
Back to top
View user's profile Send private message
mubashir.surury

New User


Joined: 29 Sep 2005
Posts: 23
Location: Pune

PostPosted: Wed Jan 31, 2007 1:48 pm    Post subject:
Reply with quote

Hi,
What we have is a REXX routine to which we define a default Jobcard to use for generating all the JCL's.What Dick says is probably the best solution.But would be a tedious one to implement as that routine is a widespread one and To change that would require Business approval.What we do is submit those member JCl's after changing the Jobname as member name.So what i want to do is implement this routine on a local basis and later on if reqd then may be the main routine itself can be updated.

ofer71,
thanks for ur prompt reply.


Regards,
Mubashir
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 85
Location: Stockholm, Sweden

PostPosted: Mon Feb 05, 2007 9:07 pm    Post subject: Re: Jobname same as Member name
Reply with quote

What SUBMITs the jobs?
What is the jobcard defined in? A skeleton?
Are they all submitted at once by a batch or online process or spasmodically, manually by one or more users?
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Thu Feb 15, 2007 3:18 am    Post subject:
Reply with quote

I have a REXX named RXPDS000 to do what I need to all members of a PDS.

Code:

/* REXX routine uses 2 parameters: pds name & subroutine name        */
/* The subroutine is called for each member of the pds - passing     */
/* the pds and member names to perform the subroutine function       */
                                                                       
/* Example to list all members of a pds:                             */
/* RXPDS000 ISC.PROD.DB2.SQLLIB RXPDSL00                             */
                                                                       
/* Author: Douglas Wilder                   */
                                                                       
Parse Upper Arg fromdsn func rest                                       
Say fromdsn ' ' func                                                   
 If 0<>listdsi("'"fromdsn"'") then                                     
  Do                                                                   
     Say 'Data set 'fromdsn' not allocated'                             
     Exit                                                               
   End                                                                 
 If 'PO'<>substr(sysdsorg,1,2) then                                     
   Do                                                                   
     Say 'Data set 'fromdsn' is not a pds'                             
     Exit                                                               
   End                                                                 
"ALLOC F(AREAD) DS('"fromdsn"') SHR REUSE DSORG(PS) LRECL(256) RECFM(F B)"
'EXECIO * DISKR AREAD ( FINIS STEM DIRS.'                               
'FREE F(AREAD)'                                                         
Do blocknum = 1 to dirs.0                                               
  block=dirs.blocknum                                                   
  Parse Var dirs.blocknum bl 3 block                                   
  block=substr(block,1,c2d(bl)-2)                                       
  Do While block<>''                                                   
    Parse Var block mbrname 9 ttr 12 c 13 block                         
    c=c2d(bitand(c,'1f'x))                                             
    If mbrname='FFFFFFFFFFFFFFFF'x then                                 
      Leave blocknum                                                   
    mbrname=strip(mbrname)                                             
    func fromdsn mbrname rest           
    If RC <> 0 then Exit(RC)           
    block=delstr(block,1,c*2)           
  End                                   
  If RC <> 0 then                       
    Do                                 
      Say "RC passed from function: " RC
    End                                 
End                                     
Exit(RC)                               



The REXX PDSJobNm to read the PDS member, change all //JOBNAME to the member name and write out the member is as follows:
Code:

/*Rexx PDSJobNm to change the job name to match PDS member name.    */
/*called from RXPDS000                                              */
/*Example: TSO RXPDS000 XXXXXXX.X.X PDSJobNm    */
/* Author: Douglas Wilder */                                         
                                                                     
Parse Upper Arg dsname name rest                                     
                                                                     
    oldval = "//JOBNAME"                                             
    newval = "//"||name                                               
                                                                     
    /* READ USING ARRAY */                                           
     FROM_NAME = "'"DSNAME"("NAME")'"                                 
    "ALLOCATE DDNAME(INFILE) SHR DSNAME(" FROM_NAME ")"               
                                                                     
    "EXECIO * DISKR INFILE (STEM RECD. FINIS"                         
    HOW_MANY = RECD.0                                                 
                                                                     
    /* CHANGE OLDVAL TO NEWVAL */                                     
    do c = 1 to how_many                                               
        strt = pos(oldval,recd.c)                                       
        do while strt > 0                                               
          ln = left(recd.c,strt-1)||newval||substr(recd.c,strt+length(oldval))
          recd.c = ln                                                   
          strt = pos(oldval,recd.c)                                     
        end                                                             
    end c                                                               
                                                                       
    /* WRITE USING ARRAY */                                             
    "EXECIO " HOW_MANY " DISKW INFILE (STEM RECD. FINIS"               
                                                                       
    "FREE DDNAME(INFILE)"                                               
                                                                       
Exit                                                                   


Change the //JOBNAME in this REXX to whatever jobname is in your JCL.
To execute these REXXs with the following command:

TSO RXPDS000 XXXXXXX.X.X PDSJobNm

where XXXXXXX.X.X is the DSN of your PDS.

The first REXX will call the second REXX for each member of the PDS.

I believe that this will fit your needs. Note: this REXX can be run online or batch.
[/code]
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am
No new posts Bind plan as a member to another bind... rexx77 DB2 0 Thu Feb 16, 2017 2:02 am
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


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