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

Create a member using REXX Code


IBM Mainframe Forums -> CLIST & REXX
Post new topic   This topic is locked: you cannot edit posts or make replies.
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
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
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: 8797
Location: Welsh Wales

PostPosted: Fri Jun 01, 2007 12:57 pm
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
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

Global Moderator


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

PostPosted: Fri Jun 01, 2007 2:21 pm
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
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
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: 194
Location: India

PostPosted: Wed Jan 30, 2008 12:10 pm
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: 206
Location: Globe, India

PostPosted: Fri Jun 22, 2012 2:01 pm
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: 2481
Location: Netherlands, Amstelveen

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

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

Active User


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

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

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

Active User


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

PostPosted: Fri Jun 22, 2012 3:48 pm
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: 6966
Location: porcelain throne

PostPosted: Fri Jun 22, 2012 4:09 pm
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

Superior Member


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

PostPosted: Fri Jun 22, 2012 6:28 pm
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

Moderator Emeritus


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

PostPosted: Fri Jun 22, 2012 6:59 pm
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. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top