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
 

 

ALLOCATE PDS and MEMBER in same REXX CODE

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

New User


Joined: 13 Aug 2007
Posts: 16
Location: Mumbai

PostPosted: Wed May 14, 2008 10:51 am    Post subject: ALLOCATE PDS and MEMBER in same REXX CODE
Reply with quote

HI ,
I am trying to allocate a PDS and A member in the same REXX code ,
well my requirement is

1. IF the PDS is not present i.e. SYSDSN( ) /= "OK"
then allocate the PDS
2. IF the Member is not present ( same as above ) then allocate the
member for output dd.

let me know if anyone can help me out on this .

Thanks,
Rishi/K
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed May 14, 2008 10:58 am    Post subject:
Reply with quote

What is the exact problem? Your requirements sounds clear for me...

O.
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: Wed May 14, 2008 11:02 am    Post subject:
Reply with quote

Hello,

Keep in mind that to create a member, you do not "allocate" it. Simply write the member into an existing PDS.
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: Wed May 14, 2008 11:14 am    Post subject:
Reply with quote

Hello,

From an offline PM
Quote:
How do i write a member directly with out allocating it to a DD name
Per your original post, it appeared that you were gong to allocate the PDS to a ddname if it existed and you would create the pds if it did not.

Once the pds exists and is allocated to your sessionk you can then write one or more members into it.

If this does not provide clarification, please advise.

It may be that i misunderstood your question.
Back to top
View user's profile Send private message
Rishi Khare

New User


Joined: 13 Aug 2007
Posts: 16
Location: Mumbai

PostPosted: Wed May 14, 2008 12:07 pm    Post subject:
Reply with quote

this is what the code looks like

IF SYSDSN(FILENAME) /= "OK" THEN DO
ADDRESS "TSO" "ALLOC DD(DD) DS("FILENAME") NEW",
"DSORG(PO) RECFM(F M) LRECL(80) SPACE(10, 5) DIR(10) TRACKS"
END

IF SYSDSN("FILENAME(MMBR)") /= "OK" THEN DO
"ALLOC DS("FILENAME(MBR)") SHR FILE(DD2)"
END

IF RC=0 THEN DO
PUSH "RIDJFGHJLGJSDFLGHDFSHI"
"EXECIO 1 DISKW DD2"
END

"EXECIO 0 DISKR DD2 (FINIS"
Back to top
View user's profile Send private message
Rishi Khare

New User


Joined: 13 Aug 2007
Posts: 16
Location: Mumbai

PostPosted: Wed May 14, 2008 12:15 pm    Post subject:
Reply with quote

throws this error at the time of writing the record in the member


IRX0250E System abend code 213, reason code 00000004.
IRX0255E Abend in host command EXECIO or address environment routine TSO.
IEA848I NO DUMP WAS PRODUCED FOR THIS ABEND, DUE TO SYSTEM OR INSTALLATION REQU
EST
IRX0670E EXECIO error while trying to GET or PUT a record.
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: Wed May 14, 2008 12:17 pm    Post subject:
Reply with quote

Does it work ?

If not, please post the error message(s)
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: Wed May 14, 2008 12:41 pm    Post subject:
Reply with quote

Try this
Code:

/* REXX *** Test pds allocation        */     
dsname = 'dataset name'                     
DSE = SYSDSN("'"strip(dsname)"'")           
If DSE <> 'OK' then do                       
  "FREE  FI(Pdsout)"                         
  "ALLOC FI(Pdsout) DA('"dsname"') new       
    tracks space(10 10) dir(44)             
    Recfm(F B) LRECL(80)"                   
End                                         
"FREE  FI(Pdsout)"                           
"ALLOC FI(Pdsout) DA('"dsname"(ABCDEF)') SHR"
push "TEST RECORD"                           
"EXECIO 1 DISKW Pdsout (FINIS"               
"FREE  FI(Pdsout)"                           
"ISPEXEC EDIT DATASET('"dsname"(ABCDEF)')"   
Exit                                         
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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


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