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
 

 

Open a member using REXX

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

New User


Joined: 19 Jun 2008
Posts: 39
Location: USA

PostPosted: Fri Nov 21, 2008 11:59 am    Post subject: Open a member using REXX
Reply with quote

Hello Everyone,

I am writing a rexx macro (say Open ) which should work as given below.

If I want to open a dataset and type TSO OPEN DMA12345 (member name), it should open the member in view mode, and currently it's doing. Now suppose I have member DMO12345 (here A is replaced by O) and I want to open both the member (or get list ) by typing DM*12345 or only 12345, what are the changes needed for macro given below???






Code:
/*        REXX      */                               
parse arg parm                                       
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"             
  ddin = 'BX5216.OSV.REL52.ADHOC.RERUN.CNTL'         
user=userid()                                       
  if strip(parm)= '' then                           
    exit                                             
  if length(strip(parm)) > 8 then                   
  do                                                 
   say "Program Name is more than 8 characters"     
    exit                                             
  End                                               
  memname=parm                                       
  do 1                                               
     ddou = ddin || "(" || memname || ")"           
     message = SYSDSN("'"ddou"'")                   
     if message = OK then                           
     do                                             
      ADDRESS ISPEXEC "VIEW DATASET('"ddou"') CHGWARN(YES)"         
      Exit(0)                                                       
    End                                                             
 End                                                               
 say memname" Not Found in baseline Libraries"                     
 Exit(0)                                                           
/* ---------------------------------------------------------*/     
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Fri Nov 21, 2008 12:06 pm    Post subject: Reply to: Open a member using REXX
Reply with quote

are you sure that is worth to reinvent the wheel ??

go to any enhanced member list display and type in the command line

Code:
s aa* v


and it will view one after the other all the members starting with aa,
but, remember, You have no way out of it,
You must go thru all the members
and keep hitting PF3
Back to top
View user's profile Send private message
trilokdewangan

New User


Joined: 19 Jun 2008
Posts: 39
Location: USA

PostPosted: Fri Nov 21, 2008 1:23 pm    Post subject:
Reply with quote

I agree with the suggestion but difference is I need to go to that particular dataset ..instead I want to access member from anywhere in ISPF panel....

As I gave the code and mentioned the Dataset name as
Code:
ddin = 'BX5216.OSV.REL52.ADHOC.RERUN.CNTL'   


Member will be find in that dataset or we can give multiple datasets......

Please suggest.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Fri Nov 21, 2008 1:25 pm    Post subject: Reply to: Open a member using REXX
Reply with quote

use the LM.... services to list and filter the members
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Sat Nov 22, 2008 1:52 am    Post subject: Reply to: Open a member using REXX
Reply with quote

VIEW already does what you want. Add error checking by checking return codes and error message variables (zerrsm,zerrlm)
Code:
/* REXX*/                                                                               
ddin= "''BX5216.OSV.REL52.ADHOC.RERUN.CNTL' 'data.set.two'"                           
mem='DM%12345'                                         
address tso 'ALLOC REUSE SHR F(XXX) DA('ddin')'   
address  ispexec                                 
'LMINIT DATAID(DATAID) DDNAME(XXX) ENQ(SHRW)'     
'VIEW DATAID('dataid') MEMBER('mem')'             
'LMFREE DATAID('dataid')'                         
address tso 'FREE F(XXX)'
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
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


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