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
 

 

Change the member name of PDS and the jobname

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

New User


Joined: 02 Nov 2009
Posts: 73
Location: Mumbai

PostPosted: Thu Mar 10, 2011 8:13 pm    Post subject: Change the member name of PDS and the jobname
Reply with quote

Hello Evryone,

I have a requirement to change the member name of PDS and then change job name with the changed name.
My REXX code is working fine with changing the member name but I am unable to change the jobname -

Below is the code I am using -

Code:

 /* REXX  */                                                     
"ISPEXEC LMINIT DATAID(DATAID) DATASET('"pds-name"'),     
ENQ(SHRW)"                                                       
"ISPEXEC LMOPEN DATAID("DATAID") OPTION(OUTPUT)"                 
OLDMEM = ""                                                       
DO FOREVER                                                       
  "ISPEXEC LMMLIST DATAID("DATAID") OPTION(LIST) MEMBER(OLDMEM)" 
  IF RC <> 0 THEN LEAVE                                           
    FIRST = SUBSTR(STRIP(OLDMEM),1,1)                             
    TEMP = SUBSTR(STRIP(OLDMEM),2,8)                             
    IF FIRST = 'Q' THEN                                           
      DO                                                         
        FRST = 'S'                                               
        NEWMEM = FRST||TEMP                                       
      END                                                         
    ELSE                                                         
    IF FIRST = 'N' THEN                                           
      DO                                                         
        PART1 = SUBSTR(STRIP(OLDMEM),1,4)             
        PART2 = SUBSTR(STRIP(OLDMEM),6,8)             
        NEWMEM = PART1||'S'||PART2                     
      END                                             
    ELSE                                               
      NEWMEM = OLDMEM                                 
    SAY NEWMEM                                         
  "ISPEXEC LMMREN DATAID("DATAID") MEMBER("OLDMEM")", 
    "NEWNAME("NEWMEM") NOENQ"                         
  SAY OLDMEM NEWMEM                       
             
 /* TRYING TO CHANGE THE JOBNAME  */                   
                         
   FROM_NAME = "'pds-name("NEWMEM")'"                           
   "ALLOCATE DDNAME(INFILE) SHR DSNAME(" FROM_NAME ")"                 
   "EXECIO * DISKR INFILE (STEM RECD. FINIS"                           
   HOW_MANY = RECD.0                                                   
                                                                       
   OLDVAL=//OLDMEM                                                       
   NEWVAL=//NEWMEM                                                       
                                                                       
   DO C=1 TO HOW_MANY                                                   
     STRT=POS(OLDVAL,RECD.C)                                           
     DO WHILE STRT > 0                                                 
      IN=LEFT(RECD.C,STRT-1)||NEWVAL||SUBSTR(RECD.C,STRT+LENGHT(OLDVAL))
      RECD.C = IN                                                       
      STRT = POS(OLDVAL,RECD.C)                                         
     END                                                               
   END C                                                               
 "EXECIO "HOW_MANY " DISKW INFILE (STEM RECD. FINIS"               
END                                                                     
"ISPEXEC LMCLOSE DATAID("DATAID")"       
EXIT 0                                   


I am getting the error - dataset name not found for allocation.

I am new to REXX.Can someone please suggest where I am going wrong. Thanks
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Mar 10, 2011 8:50 pm    Post subject:
Reply with quote

have you tried running with trace?

i would guess that the either the name you are genrating for this allocate:
"ALLOCATE DDNAME(INFILE) SHR DSNAME(" FROM_NAME ")"

is wrong or your syntax for the allocate is incorrect.
either way, trace will tell you what is going on.
Back to top
View user's profile Send private message
anshul_gugnani

New User


Joined: 02 Nov 2009
Posts: 73
Location: Mumbai

PostPosted: Thu Mar 10, 2011 8:58 pm    Post subject:
Reply with quote

Hello,

I have not used TRACE. Since I am very new to REXX,dont have much knowledge. Could you please tell how to use TRACE?

Thanks for your response.
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: Thu Mar 10, 2011 9:05 pm    Post subject:
Reply with quote

Hello,

One of the first things to learn is how to see what is happeing with your code. . .

As it happens, there are multiple topics in this Clist & REXX part of the forum that show TRACE being used (and the output from different TRACEs). Suggest you use the forum SEARCH above and review some of these topics.

If you find something that is not clear, post what you found and your doubt. Someone should be able to clarify.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu Mar 10, 2011 9:11 pm    Post subject:
Reply with quote

anshul_gugnani wrote:
Hello,

I have not used TRACE. Since I am very new to REXX,dont have much knowledge. Could you please tell how to use TRACE?

Thanks for your response.

At the point where you wish to begin tracing (I recommend the beginning, to start with, and then narrow down), include a
Code:
TRACE option

statement. To end tracing, code
Code:
TRACE O
.
Here you can read about the various options. Most senior people on this board will, I think, recommend the Results option, although I prefer the Intermediates option.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Mar 10, 2011 9:11 pm    Post subject:
Reply with quote

after your comment: /* TRYING TO CHANGE THE JOBNAME */

add this line:
Code:
TRACE ?R

which is my favorite trace method.
here is the link for the 3.23 TRACE discussion in the Reference Manual

these links are from he REXX USER'S GUIDE

1.3.3 Tracing Expressions with the TRACE Instruction

2.2.1.3.2 Options Within Interactive Trace

2.2.1.1 Tracing Commands with the TRACE Instruction

Suggest you bookmark or download the PDF versions of these two manuals.
Back to top
View user's profile Send private message
anshul_gugnani

New User


Joined: 02 Nov 2009
Posts: 73
Location: Mumbai

PostPosted: Fri Mar 11, 2011 3:41 pm    Post subject:
Reply with quote

Hello Everyone,

with TRACE option I was able to find the error and now the allocation problem is solved. However, I am getting an error with the EXECIO while writitng using array -
Code:
 "EXECIO "HOW_MANY " DISKW INFILE (STEM RECD. FINIS"


It is abending with system abend code 213. EXECIO error while trying to get or put a record.
Could anyone suggest what can be the problem.

Thanks for your help.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Mar 11, 2011 3:53 pm    Post subject: Reply to: Change the member name of PDS and the jobname
Reply with quote

and.... what does the manual say about a system 213 abend ?
Back to top
View user's profile Send private message
anshul_gugnani

New User


Joined: 02 Nov 2009
Posts: 73
Location: Mumbai

PostPosted: Fri Mar 11, 2011 3:57 pm    Post subject:
Reply with quote

Hello,

I was able to solve the problem. While allocating PDS I had specified SHR, which was wrong.

Thanks evryone for help! icon_smile.gif
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: Fri Mar 11, 2011 8:25 pm    Post subject:
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

Quote:
It is abending with system abend code 213.
At the top of the page is a link to IBM Manuals. The last set of manuals is for various Messages and Codes.

Near the end of the list is the "z/OS System Codes" with which you should become comfortable/familiar - along with z/OS System Messages VOL VII (which is the manual for IECxxxx messages.
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts How to change dataset attributes of m... ignich7 JCL & VSAM 3 Thu Jul 21, 2016 9:17 pm
No new posts File Stauts 92 with member of PDS sandip_mainframe COBOL Programming 4 Fri Jun 10, 2016 12:06 pm
No new posts GDG vsersion number change Raghu navaikulam JCL & VSAM 5 Fri May 27, 2016 4:49 pm


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