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

ALLOCATE PDS and MEMBER in same REXX CODE


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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: 2358
Location: Israel

PostPosted: Wed May 14, 2008 10:58 am
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

Moderator Emeritus


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

PostPosted: Wed May 14, 2008 11:02 am
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

Moderator Emeritus


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

PostPosted: Wed May 14, 2008 11:14 am
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
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
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: 8797
Location: Welsh Wales

PostPosted: Wed May 14, 2008 12:17 pm
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: 8797
Location: Welsh Wales

PostPosted: Wed May 14, 2008 12:41 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
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
Search our Forums:

Back to Top