View previous topic :: View next topic
|
Author |
Message |
chowdhrykapildev
New User
Joined: 05 Aug 2009 Posts: 44 Location: Hyderabad
|
|
|
|
Hello All,
I have been trying to create a new member inside a PDS, but I am getting the following error:
Code: |
ISRLS091
Permanent I/O error
A permanent input or output error is detected.
Current dialog statement:
LMMADD DATAID(ISR00031) MEMBER(MM1) STATS(NO) NOENQ |
I have used the following code to do this.
Code: |
ADDRESS ISPEXEC
"LMINIT DATASET("DSN") DATAID("DATA1") ENQ(EXCLU)"
"LMOPEN DATAID("DATA1") OPTION(OUTPUT)"
"LMPUT DATAID("DATA1") MODE(INVAR) DATALOC(DATAVAR) DATALEN(80)"
"LMMADD DATAID("DATA1") MEMBER("MEM") STATS(NO) NOENQ" |
My requirement is to create a new member and write some data into it from a stem variable.
Thanks a lot in advance. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
The below code will create a member with the variable name you specify and write one line into it.
Code: |
VAR2="USERID.YOUR.PDS("MEMBER NAME VARIABLE")"
VAR3 = VAR2
"ALLOC F(OUTDD) DS('"VAR3"') OLD REUSE"
OUT.0=1
OUT.1="THIS CAN CONTAIN ANYTHING THAT YOU WANT"
"EXECIO * DISKW OUTDD (FINIS STEM OUT."
"FREE FILE(OUTDD)"
EXIT |
Hope this helps
Regards, |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I don't see where you are looping through the LMPUT service for your stem variables, but otherwise it looks OK.
Does the DATALEN(80) agree with the LRECL of your PDS?
I'd like to see a Trace. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
permanent I/O messages usually mean that someone tried to link a load module into your PDS and thereby changed it to RECFM=U. Check ISPF to see what the record format is and if it is not fixed or variable, you need to either recreate the data set or change it back using one of the tricks you can find through a search.
The other common problem is if you try to save a member in a sequential file. Verify that the output data set is a PDS or PDSE. |
|
Back to top |
|
|
chowdhrykapildev
New User
Joined: 05 Aug 2009 Posts: 44 Location: Hyderabad
|
|
|
|
Hi all,
none of the above code is working for me..
Before I try creating a member in the PDS i have a stem variable in which all the data i want is present. Now I have to create a new member inside the PDS with the data I have in my stem variable.
The data in stem variable changes once the member is created and populated with new data and again a new member has to be created..
I have tried with the following code:
Code: |
ADDRESS ISPEXEC
"LMINIT DATASET('"DSN"') DATAID("DATA1") ENQ(EXCLU)"
ADDRESS ISPEXEC
"LMOPEN DATAID("DATA1") OPTION(OUTPUT)"
DO K=1 TO TEMP.0
CALL WRITE_REC "TEMP.K"
END
ADDRESS ISPEXEC
'LMMADD DATAID(&DATA1) MEMBER('MEM')'
'LMFREE DATAID(&DATA1)'
|
Code: |
WRITE_REC:
PARSE ARG P1
"LMPUT DATAID(&DATA1) MODE(INVAR) DATALOC(P1) DATALEN(80)"
RETURN |
Hoping the needful... Thanks a ton in advance.. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 Location: Silicon Valley
|
|
|
|
SuperK wrote:
Quote: |
I'd like to see a Trace.
|
Hint: check the syntax of your LMINIT statement. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
I would use the following code :
ADDRESS ISPEXEC
"LMINIT DATASET('"DSN"') DATAID("DATA1") ENQ(EXCLU)"
"LMOPEN DATAID("DATA1") OPTION(OUTPUT)"
DO K=1 TO TEMP.0
"LMPUT DATAID("DATA1") MODE(INVAR) DATALOC("TEMP.K") DATALEN(80)"
END
"LMMADD DATAID("DATA1") MEMBER("MEM")"
"LMFREE DATAID("DATA1")"
Some benefits are :
only one call to ADDRESS ISPEXEC
and why use a subroutine for one statement used in one place?
Hope this will help. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I wonder why no one ever checks the return code (rc in REXX)
from a CALL to a service? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Quote: |
I wonder why no one ever checks the return code (rc in REXX)
from a CALL to a service? |
If it was gotten by copy/paste from somewhere, it will surely work correctly. . . |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
the lminit syntax in the 2nd example is wrong also. data id is a variable name, not a variable value. In the worst case, using the value could mean that you try to write to the wrong data set. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
MBabu wrote: |
the lminit syntax in the 2nd example is wrong also. data id is a variable name, not a variable value. In the worst case, using the value could mean that you try to write to the wrong data set. |
Oops, my bad. The quotes around DATA1 shouldnt be there.
My apologies. |
|
Back to top |
|
|
|