Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to create a PDS member in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
banuradha

New User


Joined: 20 Dec 2006
Posts: 19
Location: India

PostPosted: Fri Jan 12, 2007 12:32 pm    Post subject: How to create a PDS member in REXX
Reply with quote

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
View user's profile Send private message

Sahoo

New User


Joined: 08 Jun 2006
Posts: 53

PostPosted: Fri Jan 12, 2007 12:37 pm    Post subject: Re: How to create a PDS member in REXX
Reply with quote

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
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Fri Jan 12, 2007 12:52 pm    Post subject:
Reply with quote

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
View user's profile Send private message
banuradha

New User


Joined: 20 Dec 2006
Posts: 19
Location: India

PostPosted: Fri Jan 12, 2007 1:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Fri Jan 12, 2007 3:22 pm    Post subject:
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Fri Jan 12, 2007 6:11 pm    Post subject: Re: How to create a PDS member in REXX
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    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 Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
This topic is locked: you cannot edit posts or make replies. Rexx to Grab ISMF Information. upendrasri All Other Mainframe Topics 16 Sun Nov 26, 2017 12:35 am
No new posts Rexx to send an email without SMTP Se... upendrasri All Other Mainframe Topics 12 Sun Nov 19, 2017 7:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us