View previous topic :: View next topic
|
Author |
Message |
anweshi
New User
Joined: 31 May 2007 Posts: 4 Location: Bangalore
|
|
|
|
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 |
|
|
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
anweshi
New User
Joined: 31 May 2007 Posts: 4 Location: Bangalore
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
If you want to use ISPF Services, you could also use the LMMADD service. |
|
Back to top |
|
|
anweshi
New User
Joined: 31 May 2007 Posts: 4 Location: Bangalore
|
|
|
|
Can u please suggest the syntax for it...
then it is very useful |
|
Back to top |
|
|
COUNT
New User
Joined: 15 Jan 2008 Posts: 6 Location: kolkata
|
|
|
|
/* 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 |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
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 |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
i have come across the same scenario. Solution suggested above, seems different from the requirement. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
And now? |
|
Back to top |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
Peter, ? |
|
Back to top |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
It is asked to change in newly created member, not to add new member. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Quote: |
Solution suggested above, seems different from the requirement |
"whose" requirement? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 . . .
Please - only reply to active topics. |
|
Back to top |
|
|
|