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

Open a member using REXX


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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 21, 2008 12:06 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 21, 2008 1:25 pm
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: 400
Location: Mumbai

PostPosted: Sat Nov 22, 2008 1:52 am
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 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