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
 
REXX Coding Problem

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

New User


Joined: 28 May 2005
Posts: 26
Location: Chennai

PostPosted: Tue Mar 21, 2006 11:56 am    Post subject: REXX Coding Problem
Reply with quote

hi all,
i wrote a program to get all members from the PDS mentiones in the PS. but it giving nothing.
please correct the errors.

Code:

/* REXX */                                         
"ALLOC DA('PS.contains.pds') F(MAD) SHR REUSE"     
"EXECIO * DISKR MAD(STEM GUN. FINIS"               
DO I= 1 TO GUN.0                                   
PDS=GUN.I                                           
     PDS= "'"STRIP(PDS,"B","'")"'"                 
     SAY PDS                                       
     A=0                                           
     X = OUTTRAP("LIBMEM.")                         
         ADDRESS TSO "LISTDS "PDS" M"               
     X = OUTTRAP("OFF")                             
     DO I = 7 TO LIBMEM.0                           
         A = A + 1                                 
         ARR.A = LIBMEM.I                           
         SAY ARR.A                                 
     END                                           
end.


PS.contains.PDS having the values
'pds.aaa.bbb'
'pds.bbbb.ccc'

Please correct the errors.
Back to top
View user's profile Send private message

Paddy

New User


Joined: 12 Sep 2005
Posts: 46
Location: Paris France

PostPosted: Tue Mar 21, 2006 3:21 pm    Post subject:
Reply with quote

Hi friend,


Here the modified code that works at my place, try the and said me this that you some think.

Code:

/* REXX */
"ALLOC DA('"Your PS name"') F(MAD) SHR REUSE"
"EXECIO * DISKR MAD(STEM GUN. FINIS"
DO I= 1 TO GUN.0
         PDS = GUN.I
         PDS = STRIP(PDS,B,)
         SAY PDS
         A=0
         X = OUTTRAP("LIBMEM.")
         ADDRESS TSO "LISTDS '"PDS"' M"
         X = OUTTRAP("OFF")
    DO I = 7 TO LIBMEM.0
              A = A + 1
              ARR.A = LIBMEM.I
              SAY ARR.A
    END
END


I hope to have to help you

Regards.

Paddy icon_razz.gif
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: Tue Mar 21, 2006 6:40 pm    Post subject: Re: please correct me
Reply with quote

pbgunasekar, a couple of points:

1. Do NOT post code and ask the forum members to fix it for you.

2. Did you not notice that you have a loop within a loop using the same loop control (DO I= 1 TO GUN.0 and DO I = 7 TO LIBMEM.0). Use a different loop control, i.e. DO J = 7 TO LIBMEM.0.

3. You did not mention what the attributes of your input dataset 'PS.contains.pds' are, but unless it is defined as RECFM=VB, or, if there are imbedded blanks after the list of PDS names, then you need to
strip the trailing blanks off. Is your LISTDS command ending with RC(12)?
Back to top
View user's profile Send private message
pbgunasekar

New User


Joined: 28 May 2005
Posts: 26
Location: Chennai

PostPosted: Wed Mar 22, 2006 10:05 am    Post subject: Re: REXX Coding Problem
Reply with quote

ok,
hereafter i will take on this.
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm

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