View previous topic :: View next topic
|
Author |
Message |
trilokdewangan
New User
Joined: 19 Jun 2008 Posts: 39 Location: USA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
are you sure that is worth to reinvent the wheel ??
go to any enhanced member list display and type in the command line
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 |
|
|
trilokdewangan
New User
Joined: 19 Jun 2008 Posts: 39 Location: USA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
use the LM.... services to list and filter the members |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
|