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

Adding a new member to an existing PDS


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chowdhrykapildev

New User


Joined: 05 Aug 2009
Posts: 44
Location: Hyderabad

PostPosted: Fri Oct 30, 2009 8:39 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Oct 30, 2009 8:50 pm
Reply with quote

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 icon_smile.gif

Regards,
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Oct 30, 2009 9:04 pm
Reply with quote

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
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Sat Oct 31, 2009 1:21 am
Reply with quote

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
View user's profile Send private message
chowdhrykapildev

New User


Joined: 05 Aug 2009
Posts: 44
Location: Hyderabad

PostPosted: Sun Nov 01, 2009 1:54 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Sun Nov 01, 2009 9:15 pm
Reply with quote

SuperK wrote:
Quote:
I'd like to see a Trace.


Hint: check the syntax of your LMINIT statement.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Nov 05, 2009 3:03 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Nov 05, 2009 3:53 pm
Reply with quote

I wonder why no one ever checks the return code (rc in REXX)
from a CALL to a service?
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 Nov 05, 2009 8:46 pm
Reply with quote

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
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Nov 05, 2009 9:06 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Nov 06, 2009 3:43 pm
Reply with quote

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
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Adding first / last acct numerber to ... DFSORT/ICETOOL 7
No new posts Adding 'ODD' and 'EVEN' indicator at ... DFSORT/ICETOOL 6
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
Search our Forums:

Back to Top