View previous topic :: View next topic
|
Author |
Message |
banuradha
New User
Joined: 20 Dec 2006 Posts: 19 Location: India
|
|
|
|
Hi all ,
How to create a PDS member using REXX
LISTDS function helps us list the members.But I need to create members
in a same PDS using REXX. |
|
Back to top |
|
|
Sahoo
New User
Joined: 08 Jun 2006 Posts: 53
|
|
|
|
DSN = A.b.c(Memname)
If you have already created a PDs and trying to create a member in it.
"alloc dataset('"dsn"') fi(outdd) shR ",
else
dsn = A.B.C
"alloc dataset('"dsn"') fi(outdd) new ",
"space(2,1) cylinders ",
"LRECL(150) ",
"dsorg(PS) ",
"recfm(F B) ",
"dir(10) " |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Hi banuradha,
You have not cleared your query or otherwise I am not getting it. Do you want to create a balnk member in the PDS or you want to write something in a new member of your PDS. However, if you want to write something in a member of your PDS, you can follow the code -
Code: |
/*REXX*/
ADDRESS TSO
dsnname = '[i]PDS Name[/i]' || '(' || [i]memname[/i] || ')'
"ALLOC DA('"dsnname"') F(LOGICAL) SHR"
"EXECIO * DISKW (STEM DATA. FINIS"
"FREE F(LOGICAL)"
|
- Where DATA is a stem having the data to be written to that member of your PDS.
If you want to create an empty member, then you can use the following code in this way also -
Code: |
/*REXX*/
ADDRESS TSO
DROP DATA.
DATA.0 = 1
dsnname = '[i]PDS Name[/i]' || '(' || [i]memname[/i] || ')'
"ALLOC DA('"dsnname"') F(LOGICAL) SHR"
"EXECIO * DISKW (STEM DATA. FINIS"
"FREE F(LOGICAL)"
|
|
|
Back to top |
|
|
banuradha
New User
Joined: 20 Dec 2006 Posts: 19 Location: India
|
|
|
|
No,I need to create 5 empty members by just running the REXX.The code u suggested is not helping me.The PDS name will not be created already.I have to create the PDS and then , have to create those members. |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Hi banuradha,
Then you have to use the corresponding code for allocating the PDS, right! That'sthe thing is incorporated in the code, so the code will not run, obviously. However, look the following code for allocation of a PDS :-
Code: |
/*REXX*/
ADDRESS TSO
"ALLOC DA('"Your Dataset Name-PDS"') F(LOGICAL) NEW SPACE(10,20) DIR(100) TRACKS"
"FREE F(LOGICAL)"
RETURN
|
N.B :- This code will create the PDS only so you have to incorporate previous code after it.
However, in the previous code, I used and to indicate the letters in italics.
So the total code wil be like -
[code]
/*REXX*/
ADDRESS TSO
"ALLOC DA('"Your Dataset Name-PDS"') F(LOGICAL) NEW SPACE(10,20) DIR(100) TRACKS"
"FREE F(LOGICAL)"
DROP DATA.
DATA.0 = 1
dsnname = 'Your Dataset Name-PDS' || '(' || Member Name || ')'
"ALLOC DA('"dsnname"') F(LOGICAL) SHR"
"EXECIO * DISKW (STEM DATA. FINIS"
"FREE F(LOGICAL)"
RETURN
[\code] |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Here's one exec with four different methods. Please note that there is no REXX facility for directly dealing with the concept of a PDS, but rather an appropriate TSO, ISPF, or batch method must be employed.
Code: |
/* REXX */
"DELETE MY.NEW.PDS1"
"DELETE MY.NEW.PDS2"
"DELETE MY.NEW.PDS3"
"DELETE MY.NEW.PDS4"
"ALLOC DA(MY.NEW.PDS1) NEW REU RECFM(F B) LRECL(80)",
"DIR(255) SPACE(10,10) TRACKS UNIT(SYSDA)"
"ALLOC DA(MY.NEW.PDS2) NEW REU RECFM(F B) LRECL(80)",
"DIR(255) SPACE(10,10) TRACKS UNIT(SYSDA)"
"ALLOC DA(MY.NEW.PDS3) NEW REU RECFM(F B) LRECL(80)",
"DIR(255) SPACE(10,10) TRACKS UNIT(SYSDA)"
"ALLOC DA(MY.NEW.PDS4) NEW REU RECFM(F B) LRECL(80)",
"DIR(255) SPACE(10,10) TRACKS UNIT(SYSDA)"
Do n = 1 To 5
"ALLOC DD(#"n") DA(MY.NEW.PDS1(#"n")) SHR REU"
Push " "
"EXECIO 1 DISKW #"n" (FINIS"
"FREE DD(#"n")"
End
"LISTDS MY.NEW.PDS1 MEMBERS"
"ALLOC DD(sysprint) DUMMY REU"
"ALLOC DD(sysut2) DA(MY.NEW.PDS2) SHR REU"
"ALLOC DD(sysin) NEW REU RECFM(F B) LRECL(80) UNIT(VIO)"
Do n = 1 To 5
Queue './ ADD NAME=#'n
Queue ' '
End
"EXECIO "Queued()" DISKW sysin (FINIS"
"CALL *(IEBUPDTE) 'NEW'"
"FREE DD(sysprint sysut2 sysin)"
"LISTDS MY.NEW.PDS2 MEMBERS"
"DELSTACK"
Do n = 1 To 5
"ISPEXEC EDIT DATASET(MY.NEW.PDS3(#"n")) MACRO(MYMAC)"
End
"LISTDS MY.NEW.PDS3 MEMBERS"
"ISPEXEC LMINIT DATAID(did) DATASET(MY.NEW.PDS4) ENQ(EXCLU)"
"ISPEXEC LMOPEN DATAID("did") OPTION(OUTPUT)"
line = ' '
Do n = 1 To 5
"ISPEXEC LMPUT DATAID("did") MODE(INVAR) DATALOC(line) DATALEN(80)"
"ISPEXEC LMMADD DATAID("did") MEMBER(#"n")"
End
"ISPEXEC LMFREE DATAID("did")"
"LISTDS MY.NEW.PDS4 MEMBERS"
|
|
|
Back to top |
|
|
|