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

Change the member name of PDS and the jobname


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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
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
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

Moderator Emeritus


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

PostPosted: Thu Mar 10, 2011 9:05 pm
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: 1788
Location: Bloomington, IL

PostPosted: Thu Mar 10, 2011 9:11 pm
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
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Mar 11, 2011 3:53 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Mar 11, 2011 8:25 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts SELECT from data change table DB2 5
No new posts Trying to change copybook in online c... CICS 4
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
Search our Forums:

Back to Top