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
 
populate members in PDS with REXX

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

Active User


Joined: 19 Mar 2009
Posts: 181
Location: Globe, India

PostPosted: Fri May 13, 2011 2:21 pm    Post subject: populate members in PDS with REXX
Reply with quote

i need to populate a list of members present in PDS.
Lets if i give input as 'E123456.REXX.PDS' as an input to REXX tool then it should be able to open the same PDS and populate the list of members present in it.

I have an initial idea of using OUTTRAP first and the fire some command.
like --
x = OUTTRAP('VAR.')
--- this is the place where i can fire command to populate the list of members present in the input PDS ---
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1931
Location: UK

PostPosted: Fri May 13, 2011 2:36 pm    Post subject:
Reply with quote

'Thanks in advance' - for what? You have not asked a question!

What are you putting into these pre-existing members? What do they already contain? What command(s) were you thinking of 'firing'? What about redundancy payments for those that are fired! What Rexx tool will you be using? Are you going to write it yourself or does it already exist? Note: Rexx itself is not a tool - it is a programming language.

Probably more questions but I think you may get the idea - your post is not thought through and the information is not presented clearly for those who have no idea about what you are really attempting to do.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1072
Location: Oostende, Belgium

PostPosted: Fri May 13, 2011 2:37 pm    Post subject:
Reply with quote

You don't fire commands on z/OS, and although English is obviously not your native language, it wouldn't hurt not to mangle it beyond comprehension...
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10373
Location: italy

PostPosted: Fri May 13, 2011 2:41 pm    Post subject: Reply to: populate members in PDS with REXX
Reply with quote

my guess is that the TS given a PDS wants to get the list of the members!

there are 3 alternatives

1. The TSO command LISTDS with the MEMBERS parameter. Trap the output and process it.

2. ISPF service LMMLIST.

3 read directly with rexx the directory see here for an example http://www.sillysot.com/ftp/mlrexx.txt
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2445
Location: Netherlands, Amstelveen

PostPosted: Fri May 13, 2011 2:42 pm    Post subject:
Reply with quote

Quote:

You don't fire commands on z/OS, and although English is obviously not your native language, it wouldn't hurt not to mangle it beyond comprehension...


<FIREWALL>
<SERVER host="local.ftpproxy.com"> </SERVER>
<FIRECMD>&REMOTE_USER;@&REMOTE_HOST;</FIRECMD>
<FIRECMD>&REMOTE_PW;</FIRECMD>
<FIREWALL

see :

http://publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.gim3000/opftp.htm
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Fri May 13, 2011 2:45 pm    Post subject:
Reply with quote

the following are two edit macros,
LISTMBRS
  • 'calls' GETMBRSR
    • uses lmm services to obtain all members of the current PDS
    • populates a variable pool item with the member names
    • returns
  • access the variable pool item and populates the current member with the pds member list


you can use the LMM services logic if you wish.

LISTMBRS
Code:

/* REXX */
  'GETMBRSR'
/*   TRACE ?R */
ADDRESS ISPEXEC VGET   (MBRLIST) SHARED
ADDRESS ISPEXEC VERASE 'MBRLIST' SHARED
ADDRESS ISREDIT
PTR = 1
LISTLEN = LENGTH(MBRLIST)
'(NUMLINES) = LINENUM' .ZLAST
IF RC <> 0 THEN
   NUMLINES = 0
DO WHILE PTR < LISTLEN
   INSERT_VALUE = '>>>>>>>' !! SUBSTR(MBRLIST,PTR,8)
   "LINE_AFTER " NUMLINES" = '"INSERT_VALUE"'"
   '(NUMLINES) = LINENUM' .ZLAST
   PTR = PTR+8
END
EXIT


GETMBRSR
Code:

/* REXX  */
ADDRESS ISREDIT 'MACRO'
/****************************************************************/
/*                                                              */
/*                                                              */
/* WILL POPULATE A VARIABLE POOL ITEM                           */
/*                    CONTAINING ALL MEMBER OF THE PDS THAT YOU */
/* ARE CURRENTLY EDITING/VIEWING                                */
/*                                                              */
/****************************************************************/
/*   TRACE ?R */
"ISREDIT ("DATA1") = DATAID"
"ISREDIT ("CURMEM") = MEMBER"
"ISREDIT ("PDSNAME") = DATASET"
/*           */
ADDRESS ISPEXEC "LMOPEN DATAID("DATA1") OPTION(INPUT)"
LMRC = RC
IF LMRC <> 0 THEN
   DO
     SAY BAD LMOPEN LMRC
     ISPEXEC "LMCLOSE DATAID("DATA1")"
     ISPEXEC "LMMLIST DATAID("DATA1") OPTION(FREE)"
     EXIT
   END
/*           */
MBRNAME= '        '
LMRC = 0
MBRLIST = ''
/*    TRACE ?R    */
DO WHILE LMRC = 0
   ISPEXEC "LMMLIST DATAID("DATA1,
           ") OPTION(LIST) MEMBER(MBRNAME,
           ) STATS(YES)"
   LMRC = RC
   IF LMRC = 0  THEN
      DO
        LENMBR  = LENGTH(MBRNAME)
        IF LENMBR < 8 THEN
           DO
             LENMBR = 8 - LENMBR
             PLUG = SPACES(LENMBR)
             MBRNAME = MBRNAME!!PLUG
           END
        MBRLIST = MBRLIST!!MBRNAME
      END
END
ISPEXEC "LMMLIST DATAID("DATA1") OPTION(FREE)"
ISPEXEC "LMCLOSE DATAID("DATA1")"
ISPEXEC "VPUT  (MBRLIST) SHARED"
EXIT
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Fri May 13, 2011 3:23 pm    Post subject:
Reply with quote

having tried both my method (LMM.. services) and Doug Nadel's procedure,
i find Doug's is much quicker to obtain the member names.

but on another note, here is yet again, a REXX tool to provide the function of SAVE while in an EDIT/VIEW/BROWSE member list.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10373
Location: italy

PostPosted: Fri May 13, 2011 3:29 pm    Post subject: Reply to: populate members in PDS with REXX
Reply with quote

agree with You icon_biggrin.gif , it is nice not to depend on the ISPF environment and the OUTTRAP stuff
and here is a simplified version of Doug Nadel example processing just the names
Code:
****** ***************************** Top of Data ******************************
000001 /*rexx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000002 /*                                                                   */
000003 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000004 Trace  "O"
000005 parse upper arg ds
000006 if listdsi(ds) \= 0 then do
000007     say "dataset '"ds"' not found"
000008     return 16
000009 end
000010 if substr(sysdsorg,1,2) \= "PO" then do
000011     say "dataset '"ds"' is not PO"
000012     return 16
000013 end
000014 Address TSO
000015 "ALLOC FI(DD) DA("DS") SHR REUS DSORG(PS) RECFM (F B) LRECL(256)"
000016 "EXECIO * DISKR DD ( STEM DIR. FINIS"
000017 "FREE FI(DD)"
000018 do idir = 1 to dir.0
000019    blk = substr(dir.idir,3,c2d(left(dir.idir,2))-2)
000020    do while blk \= ""
000021       parse var blk mbr 9 ttr 12 usr 13 .
000022       if mbr = 'ffffffffffffffff'x then ,
000023          leave idir
000024       say "==> " mbr
000025       blk = delstr(blk,1,c2d(bitand(usr,'1f'x))*2+12)
000026    end
000027 end
****** **************************** Bottom of Data ****************************
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 181
Location: Globe, India

PostPosted: Fri May 13, 2011 3:47 pm    Post subject:
Reply with quote

Hi enrico, you guessed right !

Its working absolutely fantastic with LISTDS command with MEMBERS option...

Thanks all !!!
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