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
 

 

Create a member using REXX Code

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
anweshi

New User


Joined: 31 May 2007
Posts: 4
Location: Bangalore

PostPosted: Fri Jun 01, 2007 10:18 am    Post subject: Create a member using REXX Code
Reply with quote

Hi All...
can u please help me regarding this???

How to create a new member in a newly created PDS using REXX code??
Back to top
View user's profile Send private message

saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Fri Jun 01, 2007 11:35 am    Post subject:
Reply with quote

Hi,

Use the below Code

Code:
/*Ceates PDS*/
ADDRESS TSO                                                   
   "ALLOCATE DATASET('"PDS_name"') F(DAT) NEW SPACE(50,20) DIR(10)",
 "DSORG(PO) RECFM(F,B) LRECL(80) BLKSIZE(8000)"             
 "FREE F(DAT)"                                               
/*Assingn the DD name to member*/
"ALLOC DA('"PDS_name(member_name)"') F(MYOTDD)  OLD REUSE"
/*Write a line into new member*/
QUEUE "New Member "                           
"EXECIO * DISKW  MYOTDD (FINIS "               
"FREE F(OUTFILE)"         



Thanks
Sai
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Jun 01, 2007 12:57 pm    Post subject:
Reply with quote

Quote:
"DSORG(PO) RECFM(F,B) LRECL(80) BLKSIZE(8000)"

Why the BLKSIZE of 8000 ???
Why not 27920 - the optimum for an 80 byte record length.
Back to top
View user's profile Send private message
anweshi

New User


Joined: 31 May 2007
Posts: 4
Location: Bangalore

PostPosted: Fri Jun 01, 2007 1:02 pm    Post subject:
Reply with quote

Thanks Saiprasadh.....
The code worked

Also have a problem. I need to edit a dataset and need to change a string.
I need to change string '0017' by '0014'. Below is the code which I used to do that

ADDRESS ISPEXEC "EDIT DATASET('XA04.ENDEVOR.ELEMENT(JK0014)')"

ADDRESS ISREDIT ?C '0017' '0014' ALL"

It is opening the dataset in edit mode but the change function is not working. Any help in this regard......

I am very thank ful to you.
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Fri Jun 01, 2007 2:21 pm    Post subject: Re: Create a member using REXX Code
Reply with quote

If you want to use ISPF Services, you could also use the LMMADD service.
Back to top
View user's profile Send private message
anweshi

New User


Joined: 31 May 2007
Posts: 4
Location: Bangalore

PostPosted: Fri Jun 01, 2007 2:47 pm    Post subject:
Reply with quote

Can u please suggest the syntax for it...
then it is very useful
Back to top
View user's profile Send private message
COUNT

New User


Joined: 15 Jan 2008
Posts: 6
Location: kolkata

PostPosted: Wed Jan 30, 2008 12:03 pm    Post subject:
Reply with quote

/* REXX - ADDING A MEMBER INTO A DATASET */

SAY 'USER ID :'SYSVAR('SYSUID')
ADDRESS ISPEXEC
SAY "ENTER THE DATASET name "
PARSE UPPER PULL DSN
SAY "ENTER THE MEMBER NAME U WANT TO ADD"
PARSE UPPER PULL MEM

"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)"

IF RC = 0 THEN
SAY "MEMBER ADDED!!"
ELSE
SAY "MEMBER NOT ADDED, RC = " RC

EXIT
[/img]
Back to top
View user's profile Send private message
HappySrinu

Active User


Joined: 22 Jan 2008
Posts: 195
Location: India

PostPosted: Wed Jan 30, 2008 12:10 pm    Post subject:
Reply with quote

COUNT wrote:
/* REXX - ADDING A MEMBER INTO A DATASET */

SAY 'USER ID :'SYSVAR('SYSUID')
ADDRESS ISPEXEC
SAY "ENTER THE DATASET name "
PARSE UPPER PULL DSN
SAY "ENTER THE MEMBER NAME U WANT TO ADD"
PARSE UPPER PULL MEM

"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)"

IF RC = 0 THEN
SAY "MEMBER ADDED!!"
ELSE
SAY "MEMBER NOT ADDED, RC = " RC

EXIT
[/img]


Thanks much Pritesh . this code is helpful to every one who want to use it.
Appreciate it
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 181
Location: Globe, India

PostPosted: Fri Jun 22, 2012 2:01 pm    Post subject:
Reply with quote

i have come across the same scenario. Solution suggested above, seems different from the requirement.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Fri Jun 22, 2012 2:24 pm    Post subject:
Reply with quote

And now?
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 181
Location: Globe, India

PostPosted: Fri Jun 22, 2012 3:47 pm    Post subject:
Reply with quote

Peter, ?
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 181
Location: Globe, India

PostPosted: Fri Jun 22, 2012 3:48 pm    Post subject:
Reply with quote

It is asked to change in newly created member, not to add new member.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Jun 22, 2012 4:09 pm    Post subject:
Reply with quote

FFS, how does one change data in a ds?

by either reading the ds into memory, making the changes and rewriting the ds

or

hold your breath now,

by invoking an EDIT or VIEW on the ds using the MACRO option
the macro making the changes and 'saving' the ds.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Jun 22, 2012 6:28 pm    Post subject:
Reply with quote

Quote:
Solution suggested above, seems different from the requirement
"whose" requirement? icon_eek.gif icon_biggrin.gif
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: Fri Jun 22, 2012 6:59 pm    Post subject:
Reply with quote

Hello,

Was there some reason to post this reply
Quote:
i have come across the same scenario. Solution suggested above, seems different from the requirement.
to a topic that has been dormant for over 4 years . . . icon_confused.gif

Please - only reply to active topics.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts REXX WTO for console message bipinpeter CLIST & REXX 6 Tue Jun 27, 2017 3:56 pm


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