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
 

 

Quick Browse / Quick Edit of DASD M/F data sets

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

New User


Joined: 07 Feb 2007
Posts: 2
Location: Chicago, IL

PostPosted: Thu Feb 08, 2007 8:06 pm    Post subject: Quick Browse / Quick Edit of DASD M/F data sets
Reply with quote

I am a contractor / mainframe applications programmer. I was at a client site about five years ago and one of the programmers there had coded a 'quick browse (qb)' and 'quick edit (qe)' routine that could be used while editing or viewing (not browsing) a job stream in ISPF.

If we typed QB (for browse) or QE (for edit) at the command line and then positioned the cursor anywhere on the data set name in the jobstream, we were taken directly into the DASD data set selected in whatever mode was requested (qb or qe). Once we were in the data set we could 'cancel' out to return to the job stream.

I remember someone saying that this was all accomplished with a CLIST, although I didn't ever actually see the code. Is this a common routine? If it is, can anyone direct me to code that I could use to make this happen where I am currently on assignment? I'm a COBOL, CICS, DB2, VSAM coder and don't have much experience with CLISTs, just a couple training course through the years, but no real experience to speak of.

Your help and input is appreciated on this one.

Sincerely,

Brian
Back to top
View user's profile Send private message

cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Feb 08, 2007 8:34 pm    Post subject: Re: Quick Browse / Quick Edit of DASD M/F data sets
Reply with quote

The CMENU REXX can drive all the others. Using CMENU with the cursor under a dataset will give you the options to do all the other cursor commands or you can use the individual commands (CB, CL, CR, CHR, CI, CDEL, or CE)

CMENU REXX
Code:

/* CMENU (CURSOR MENU) TSO REXX EXEC - CREATED ON 10-09-92           */
/* This Macro will display a MENU of available cursor position       */
/* EDIT MACROS.    Use either 1 or 2.                                */
/*    1.  Type cmenu on command line, move cursor to DSN, hit ENTER. */
/*    2.  Setup a PF key to cmenu, move cursor to DSN, hit PF key.   */
address ISPEXEC
'CONTROL ERRORS RETURN'
address ISREDIT
'MACRO PROCESS'
'(CL,CC) = CURSOR'
if cc = 0 then exit

delim = "~'!%?&-_=+?\{};:`<,>/?" '"'
'ISREDIT (LINE) = LINE .ZCSR'
end = length(line)
start = end - verify(reverse(line)" ",delim,"M",end-cc+1)+2
end = verify(line"",delim,"M",cc)-1

if start > end then exit
word = substr(line,start,end-start+1)

say '    Enter the letter designation or macro name at the prompt......'
say '           MACRO NAME       DESCRIPTION           ';say
say '      A.       cl       - LOCATE a dataset        '
say '      B.       ci       - dataset INFORMATION     '
say '      C.       cb       - BROWSE dataset          '
say '      D.       ce       - EDIT dataset            '
say '      E.       cr       - RENAME dataset      '
say '      F.       chr      - HRECALL migrated dataset '
say ?      G.       cdel     - DELETE a dataset        ?


say;
pull resp
parse var resp res suff
address ISPEXEC "VPUT (SUFF) PROFILE"

select
  when res = A ? res = 'CL' then call cl
  when res = B ? res = 'CI' then call ci
  when res = C ? res = 'CB' then call cb
  when res = D ? res = 'CE' then call ce
  when res = E ? res = 'CR' then call cr
  when res = F ? res = 'CHR' then call chr
  when res = G ? res = 'CDEL' then call cdel
  otherwise
    do
      say 'Invalid response, try again....'
    end
end

"ISREDIT CURSOR = "cl cc
exit

clr:
address tso CLRSCRN
pull 'aa' /* dummy pull needed to help clear *** */
return


CL - Cursor Locate - This one just tells you if the dataset exists:
Code:

/* CL (Checks for DSN) TSO REXX EXEC - CREATED ON 02-27-92           */
/* This Macro will verify that a DSN exists.  Use either 1 or 2.     */
/*      1.  Type cl on command line, move cursor to DSN to check,    */
/*          hit ENTER.                                               */
/*      2.  Setup a PF key to cl, move cursor to DSN to check,       */
/*          hit your PF key.                                         */
address ISPEXEC
'CONTROL ERRORS RETURN'
address ISREDIT
'MACRO PROCESS'
/* 'MACRO NOPROCESS' */
'(CL,CC) = CURSOR'
if cc = 0 then exit

/* delim = "~'!@#$%?&-_=+?\{()};:`<,>/?" '"' */
delim = "~'!%?&-_=+?\{};:`<,>/?" '"'
'ISREDIT (LINE) = LINE .ZCSR'
end = length(line)
start = end - verify(reverse(line)" ",delim,"M",end-cc+1)+2
end = verify(line"",delim,"M",cc)-1

if start > end then exit
word = substr(line,start,end-start+1)

address ISPEXEC
x = SYSDSN("'"word"'")
if x = 'OK' then
  do
    ZEDSMSG = x", file is found........."
    ZEDLMSG = x", file is found........."
  end
else
  do
    ZEDSMSG = x
    ZEDLMSG = x".  Check filename and retry!"
  end
ADDRESS ISPEXEC "SETMSG MSG(ISRZ001)"
"ISREDIT CURSOR = "cl cc

exit


CI - Cursor info - This one tell you the dataset attributes.
Code:

/* CI (CURSOR INFO) TSO REXX EXEC - CREATED ON 05-28-92              */
/* This Macro will return dataset information.  Use either 1 or 2.   */
/*      1.  Type ci on command line, move cursor to DSN, hit ENTER.  */
/*      2.  Setup a PF key to ci, move cursor to DSN, hit PF key.    */
address ISPEXEC
'CONTROL ERRORS RETURN'
address ISREDIT
'MACRO PROCESS'
'(CL,CC) = CURSOR'
if cc = 0 then exit

/* delim = "~'!@#$%?&-_=+?\{()};:`<,>/?" '"' */
delim = "~'!%?&-_=+?\{};:`<,>/?" '"'
'ISREDIT (LINE) = LINE .ZCSR'
end = length(line)
start = end - verify(reverse(line)" ",delim,"M",end-cc+1)+2
end = verify(line"",delim,"M",cc)-1

if start > end then exit
word = substr(line,start,end-start+1)

address tso
x = LISTDSI("'"word"'")
if sysmsglvl2 ?= ' ' then
  do
    ZEDLMSG = sysmsglvl2
    ADDRESS ISPEXEC "SETMSG MSG(ISRZ001)"
    "ISREDIT CURSOR = "cl cc
    exit
  end
say 'DATA SET NAME:         ' sysdsname
say;
say '   Volume serial:         ' sysvolume
say '   Device type:           ' sysunit',',
    '(trks/cyl 'systrkscyl', blks/trk 'sysblkstrk')'
say '   Organization:          ' sysdsorg
say '   Record format:         ' sysrecfm
say '   Record length:         ' syslrecl
say '   Block size:            ' sysblksize
say '   Allocation units:      ' sysunits
say '   Space allocated:       ' sysalloc
say '   Space used:            ' sysused
say '   Primary allocation:    ' sysprimary
say '   Secondary allocation:  ' sysseconds
say '   Extents used:          ' sysextents
say '   Creation date:         ' syscreate
say '   Expiration date:       ' sysexdate

"ISREDIT CURSOR = "cl cc
exit


CB - Cursor Browse - This one browses a dataset
Code:

/* CB (CURSOR BROWSE) TSO REXX EXEC - CREATED ON 02-27-92            */
/* This Macro will BROWSE a dataset.  Use either 1 or 2.             */
/*      1.  Type cb on command line, move cursor to DSN to BROWSE.   */
/*          hit ENTER.                                               */
/*      2.  Setup a PF key to cb, move cursor to DSN to BROWSE.      */
/*          hit your PF key.                                         */
address ISPEXEC
'CONTROL ERRORS RETURN'
address ISREDIT
'MACRO PROCESS'
'(CL,CC) = CURSOR'
if cc = 0 then exit

/* delim = "~'!@#$%?&-_=+?\{()};:`<,>/?" '"' */
delim = "~'!%?&-_=+?\{};:`<,>/?" '"'
'ISREDIT (LINE) = LINE .ZCSR'
end = length(line)
start = end - verify(reverse(line)" ",delim,"M",end-cc+1)+2
end = verify(line"",delim,"M",cc)-1

if start > end then exit
word = substr(line,start,end-start+1)

address ISPEXEC CONTROL DISPLAY SAVE
address
"BROWSE DATASET('"word"')"
address ISPEXEC CONTROL DISPLAY RESTORE

if rc > 0 then "SETMSG MSG("zerrmsg")"
"ISREDIT CURSOR = "cl cc
exit


CE - Cursor edit - This one edits a dataset
Code:

/* CE (CURSOR EDIT) TSO REXX EXEC - CREATED ON 02-27-92              */
/* This Macro will EDIT a dataset.  Use either 1 or 2.               */
/*      1.  Type ce on command line, move cursor to DSN to EDIT.     */
/*          hit ENTER.                                               */
/*      2.  Setup a PF key to ce, move cursor to DSN to EDIT.        */
/*          hit your PF key.                                         */
address ISPEXEC
'CONTROL ERRORS RETURN'
address ISREDIT
'MACRO PROCESS'
'(CL,CC) = CURSOR'
if cc = 0 then exit

/* delim = "~'!@#$%?&-_=+?\{()};:`<,>/?" '"' */
delim = "~'!%?&-_=+?\{};:`<,>/?" '"'
'ISREDIT (LINE) = LINE .ZCSR'
end = length(line)
start = end - verify(reverse(line)" ",delim,"M",end-cc+1)+2
end = verify(line"",delim,"M",cc)-1

if start > end then exit
word = substr(line,start,end-start+1)

address ISPEXEC CONTROL DISPLAY SAVE
address
"EDIT DATASET('"word"')"
address ISPEXEC CONTROL DISPLAY RESTORE

if rc > 0 then "SETMSG MSG("zerrmsg")"
"ISREDIT CURSOR = "cl cc
exit


CR - Cursor rename - This one renames a dataset - must have authority.
Code:

/* CR (CURSOR RENAME) TSO REXX EXEC - CREATED ON 06-23-92            */
/* This Macro will RENAME a dataset.  Use either 1 or 2.             */
/*      1.  Type cr on command line, move cursor to DSN to EDIT.     */
/*          hit ENTER.                                               */
/*      2.  Setup a PF key to cr, move cursor to DSN to EDIT.        */
/*          hit your PF key.                                         */
address ISPEXEC
'CONTROL ERRORS RETURN'
address ISREDIT
'MACRO PROCESS'
'(CL,CC) = CURSOR'
if cc = 0 then exit

/* delim = "~'!@#$%?&-_=+?\{()};:`<,>/?" '"' */
delim = "~'!%?&-_=+?\{};:`<,>/?" '"'
'ISREDIT (LINE) = LINE .ZCSR'
end = length(line)
start = end - verify(reverse(line)" ",delim,"M",end-cc+1)+2
end = verify(line"",delim,"M",cc)-1

if start > end then exit
word = substr(line,start,end-start+1)

say 'The dataset to rename is 'word'.'
say;say;say 'Please enter at the prompt the new name,'
say '  or "HI" to EXIT.     ';say
pull word2
if word2 = 'HI' then exit
address tso
"RENAME '"word"','"word2"'"
say;say;say 'Rename to 'word2 'has been successful.';say

if rc > 0 then "SETMSG MSG("zerrmsg")"
"ISREDIT CURSOR = "cl cc
exit


CHR - Cursor recall - This one issues a recall to the migrated dataset
Code:

/* CHR (CURSOR HRECALL) TSO REXX EXEC - CREATED ON 11-11-92          */
/* This Macro will HRECALL the migrated dataset at cursor position.  */
/*      1.  Type chr at command, move cursor to DSN, hit ENTER.      */
/*      2.  Setup PFkey to chr, move cursor to DSN, hit PF key.      */
address ISPEXEC
'CONTROL ERRORS RETURN'
address ISREDIT
'MACRO PROCESS'
'(CL,CC) = CURSOR'
if cc = 0 then exit

/* delim = "~'!@#$%?&-_=+?\{()};:`<,>/?" '"' */
delim = "~'!%?&-_=+?\{};:`<,>/?" '"'
'ISREDIT (LINE) = LINE .ZCSR'
end = length(line)
start = end - verify(reverse(line)" ",delim,"M",end-cc+1)+2
end = verify(line"",delim,"M",cc)-1

if start > end then exit
word = substr(line,start,end-start+1)

address TSO
"HRECALL '"word"'"

"ISREDIT CURSOR = "cl cc
exit


CDEL - Cursor DELETE - This one deletes a dataset.
Code:

/* CDEL (CURSOR DELETE) TSO REXX EXEC      */
/* This Macro will DELETE any dataset at cursor position.           */
/*      1.  Type CDEL at command, move cursor to DSN, hit ENTER.    */
/*      2.  Setup PFkey to CDEL, move cursor to DSN, hit PF key.    */
address ISPEXEC                                                       
'CONTROL ERRORS RETURN'                                               
address ISREDIT                                                       
'MACRO PROCESS'                                                       
'(CL,CC) = CURSOR'                                                     
if cc = 0 then exit                                                   
                                                                       
/* delim = "~'!@#$%*&-_=+3\{()};:`<,>/?" '"' */                       
delim = "~'!%*&-_=+3\{};:`<,>/?" '"'                                   
'ISREDIT (LINE) = LINE .ZCSR'                                         
end = length(line)                                                     
start = end - verify(reverse(line)" ",delim,"M",end-cc+1)+2           
end = verify(line"",delim,"M",cc)-1                                   
                                                                       
if start > end then exit                                               
word = substr(line,start,end-start+1)                                 
                                           
ADDRESS TSO "DELETE ('"||word||"') PURGE"   
                                           
"ISREDIT CURSOR = "cl cc                   
exit                                       
Back to top
View user's profile Send private message
BrianJStellhorn

New User


Joined: 07 Feb 2007
Posts: 2
Location: Chicago, IL

PostPosted: Fri Feb 09, 2007 1:08 am    Post subject: Re: Quick Browse / Quick Edit of DASD M/F data sets
Reply with quote

Many, many thanks, especially for the super quick response!! I'll give it a shot and let you know how it goes. Brian
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Fri Feb 09, 2007 1:38 am    Post subject: Re: Quick Browse / Quick Edit of DASD M/F data sets
Reply with quote

These REXXs were written by a friend back in 92 who has since retired from mainframe work. They have become invaluable to speed through navigating TSO especially for analysts that work regularly with datasets and JCL/PROCS.

You will want to store these in one of your shared REXX libraries. They can be found by doing a TSO ISRDDN and forwarding down until you see SYSEXEC. The datasets out to the right are your REXX libraries.

One consideration is that you want to ensure that the REXX names you are installing (CI, CB, CE, CHR, CMENU, etc.) are not currently in use in your complex. You could test this by enter CI and TSO CI on the command line and see if it is "not found". If you get a hit, you may need to rename one or more of them and fix CMENU to use the new name.
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 85
Location: Stockholm, Sweden

PostPosted: Mon Feb 12, 2007 12:54 am    Post subject: Re: Quick Browse / Quick Edit of DASD M/F data sets
Reply with quote

Nice EditMacros,
It's funny that so many of us came up with identical names (of course not at code level!) to supply certain shortfalls.
Perhaps, I need to check, IPT which is IBM's blue-rinse of ISOGON(which they acquired)'s SPIFFY will have this functionality.
I suspect it does - but get your installation to enquire about IPT anyhow - may even be free?!!
IF not I may shoot a pleading email off to the ISPF developers in Perth to ask - I never realy thought about it
I enjoy designing workarounds so much! oops!!.
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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm


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