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
 

 

Adding a new member to an existing PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Adding a new member to an existing PDS
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: 1475
Location: Chennai

PostPosted: Fri Oct 30, 2009 8:50 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Oct 30, 2009 9:04 pm    Post subject: Reply to: Adding a new member to an existing PDS
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: 401
Location: Mumbai

PostPosted: Sat Oct 31, 2009 1:21 am    Post subject:
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    Post subject: Reply to: Adding a new member to an existing PDS
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

Senior Member


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

PostPosted: Sun Nov 01, 2009 9:15 pm    Post subject: Reply to: Adding a new member to an existing PDS
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: 2429
Location: Netherlands, Amstelveen

PostPosted: Thu Nov 05, 2009 3:03 pm    Post subject: Adding a new member to an existing PDS
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    Post subject:
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

Site Director


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

PostPosted: Thu Nov 05, 2009 8:46 pm    Post subject: Reply to: Adding a new member to an existing PDS
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: 401
Location: Mumbai

PostPosted: Thu Nov 05, 2009 9:06 pm    Post subject:
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: 2429
Location: Netherlands, Amstelveen

PostPosted: Fri Nov 06, 2009 3:43 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am
No new posts Bind plan as a member to another bind... rexx77 DB2 0 Thu Feb 16, 2017 2:02 am
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm


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