View previous topic :: View next topic
|
Author |
Message |
anshul_gugnani
New User
Joined: 02 Nov 2009 Posts: 73 Location: Mumbai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
anshul_gugnani
New User
Joined: 02 Nov 2009 Posts: 73 Location: Mumbai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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
statement. To end tracing, code
.
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
anshul_gugnani
New User
Joined: 02 Nov 2009 Posts: 73 Location: Mumbai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
and.... what does the manual say about a system 213 abend ? |
|
Back to top |
|
|
anshul_gugnani
New User
Joined: 02 Nov 2009 Posts: 73 Location: Mumbai
|
|
|
|
Hello,
I was able to solve the problem. While allocating PDS I had specified SHR, which was wrong.
Thanks evryone for help! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for letting us know
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 |
|
|
|