HotKey to directly access a file

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

padair
Member
Posts: 11
Joined: Wed May 13, 2009 1:02 pm

HotKey to directly access a file

Post by padair » Mon Jul 26, 2010 1:18 pm

Hi there,
Hoping that someone can help me. I am looking for a solution to something that I saw in a previous job.

A few years ago when I was working for a different company, if I ever wanted to look at a file whilst I was looking at the JCL all I would need to do would be to place the cursor over the file and hit an action key (a PF key) .

This would directly take me into the file in edit mode. Does anyone know how I would set this up.

I am working on OS390.

Thanks in advance.

edit: making the subject more descriptive.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Mon Jul 26, 2010 2:20 pm

Probably you want to write a "cursor sensitive macro", do you?
Regards,
Anuj

padair
Member
Posts: 11
Joined: Wed May 13, 2009 1:02 pm

Post by padair » Mon Jul 26, 2010 4:59 pm

Hi Anuj,
I think that is precisely what I am wanting to do. Do you know of any resource that tells me how to do that? Is it possible to use REXX?

deepu
Member
Posts: 15
Joined: Fri Apr 24, 2009 10:40 am

Post by deepu » Mon Aug 16, 2010 6:47 pm

HI,

I am exactly not sure what you are looking for but try this...may help you..

Assign PDFDSN E to any of the function key from your starting mainframe screen, you can get that screen by typing KEYS on first screen after your login.

Once you assign the PF key it will directly take you to the edit mode..when you place a cursor below that file and press PF KEY....

Thanks,
Pradeep.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Aug 17, 2010 2:49 pm

This edit macro allows the user to VIEW the data set located on the line that the cursor is on. The cursor can be anywhere on a line that has DSN= or DSNAME= but must be at the start of the data set name if there is no DSN= or DSNAME=.

Code: Select all

/* REXX */                                         
/* TRACE ?R */                                     
Address ISREDIT                                    
"MACRO"                                            
Address ISPEXEC "CONTROL ERRORS RETURN"                                 
Address ISPEXEC "VGET ZPCFMCN PROFILE"         /* get confirm setting */
If ZPCFMCN == '/' then CONF = 'YES'                                     
  Else CONF = 'NO'                                                      
  /***********************************************/                     
  /*   BEGIN PROCESSING                          */                     
  /***********************************************/                     
  "(row,col) = CURSOR"                                                  
  "(data1) = LINE " row              /* data1 = cursor line          */ 
  /**********************************/                                  
  /* Find start of data set name    */                                  
  /**********************************/                                  
  dsnstart = Pos('DSN=',data1)       /* look for DSN=                */ 
  If dsnstart = 0 then do            /* no DSN =                     */ 
    dsnstart = Pos('DSNAME=',data1)  /* look for DSNAME=             */ 
    If dsnstart = 0 then do          /* no DSN= or DSNAME=           */ 
      "CURSOR = " row col            /* cursor pos                   */ 
      If col < 1 then dsnstart = 1   /* needed for ZV line cmd       */ 
      Else dsnstart = col            /* assume cursor on DSN         */ 
    End                                                                 
    Else dsnstart = dsnstart + 7     /* DSNAME= specified in JCL     */ 
  End /* if dsnstart = 0 */                                             
  Else dsnstart = dsnstart + 4       /* DSN = specified in JCL       */ 
  /**********************************/                                  
  /* Find end of data set name      */                                  
  /**********************************/                                  
  dsnend = Pos&#40;',',data1,dsnstart&#41;   /* look for comma at end of dsn */ 
  If dsnend = 0 then do              /* no comma found               */ 
    dsnend = Pos&#40;' ',data1,dsnstart&#41; /* look for blank to end DSN    */ 
    If dsnend = 0 then do            /* no blank or comma at end     */ 
      zedsmsg = 'No end of DSN'                                         
      zedlmsg = 'The data set name is not terminated with a' ,          
                'space or comma.'                                       
      Address ISPEXEC "SETMSG MSG&#40;ISRZ001&#41;"      /* msg - with alarm */ 
      "CURSOR = " row col /* put cursor back to last position        */ 
      Exit 8                                                            
    End  /* if dsnend = 0 */                                            
    Else dsnend = dsnend - 1         /* DSN ends with blank          */ 
  End /* if dsnend = 0 */                                               
  Else dsnend = dsnend - 1           /* DSN ends with comma          */ 
  /**********************************/                                  
  /* VIEW the data set              */                                  
  /**********************************/                                  
  dsn = Substr&#40;data1,dsnstart,dsnend-dsnstart+1&#41; /* extract dsn     */  
  dsn = Strip&#40;Translate&#40;dsn,"","'"&#41;&#41;       /* remove quotes if used */  
  Address ISPEXEC "VIEW DATASET&#40;'"dsn"'&#41; CONFIRM&#40;"conf"&#41;"               
  If RC <> 0 then Address ISPEXEC "SETMSG MSG&#40;"ZERRMSG"&#41;"               
  "CURSOR = " row col /* put cursor back to last position        */     
  Exit 0
Regards,
Anuj

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Aug 17, 2010 2:51 pm

Pradeep (deepu) -- PDFDSN sounds like an in-house macro/tool...
Regards,
Anuj

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Wed Aug 18, 2010 3:57 pm

Following info may be useful..

Open the jcl.. type KEYS command.
set PF4 command to DSNVIEW command.
It will work in all members in that PDS.

Code: Select all

Key    Definitions                Format   Labels
PF4     DSNVIEW                 LONG      DSNVIEW

Now in any member in that PDS if you place cursor on the file name and press PF4 key that file will be opened in edit mode.

padair
Member
Posts: 11
Joined: Wed May 13, 2009 1:02 pm

Post by padair » Wed Aug 25, 2010 6:41 pm

Krishna wrote:Following info may be useful..

Open the jcl.. type KEYS command.
set PF4 command to DSNVIEW command.
It will work in all members in that PDS.

Code: Select all

Key    Definitions                Format   Labels
PF4     DSNVIEW                 LONG      DSNVIEW

Now in any member in that PDS if you place cursor on the file name and press PF4 key that file will be opened in edit mode.
@Krishna,
Thanks for hte suggestion. I tried the DSNVIEW but I get the following message.

COMMAND DSNVIEW NOT FOUND
***

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Aug 25, 2010 6:58 pm

padair,
why have you not tried using the macro that Anuj provided?

there is no IBM offered macro or command that accomplishes what you want.

all the other suggestions are in-house macros, and as such need to be in your system.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

padair
Member
Posts: 11
Joined: Wed May 13, 2009 1:02 pm

Post by padair » Wed Aug 25, 2010 7:27 pm

dbzTHEdinosauer wrote:padair,
why have you not tried using the macro that Anuj provided?

there is no IBM offered macro or command that accomplishes what you want.

all the other suggestions are in-house macros, and as such need to be in your system.
That is what I am trying now. I had to google the REXX Userguide to see how to setp the script and see where to put it and how to execute it.

Padair.

MrSpock
Active Member
Posts: 273
Joined: Wed Jun 27, 2007 5:37 pm

Post by MrSpock » Wed Aug 25, 2010 8:11 pm

Go to the CBT Tape website.

Download the file File # 671 ZOOM edit macro to "cursor retrieve" datasets.

Follow the instructions for installing it on your system, or better yet, have your Systems Programming team install it for you and your entire shop.

padair
Member
Posts: 11
Joined: Wed May 13, 2009 1:02 pm

Post by padair » Wed Aug 25, 2010 8:25 pm

MrSpock wrote:Go to the [url=http://www.cbttape-----/]CBT Tape[/url] website.

Download the file File # 671 ZOOM edit macro to "cursor retrieve" datasets.

Follow the instructions for installing it on your system, or better yet, have your Systems Programming team install it for you and your entire shop.
Thanks for all of the help folks.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Aug 26, 2010 8:21 pm

padair wrote:That is what I am trying now. I had to google the REXX Userguide to see how to setp the script and see where to put it and how to execute it.
So, what did you try?
Regards,
Anuj

MMFC
Member
Posts: 3
Joined: Tue Sep 12, 2017 12:28 am

DSNVIEW CLIST - REXX

Post by MMFC » Tue Sep 12, 2017 12:46 am

Krishna wrote:Following info may be useful..

Open the jcl.. type KEYS command.
set PF4 command to DSNVIEW command.
It will work in all members in that PDS.

Code: Select all

Key    Definitions                Format   Labels
PF4     DSNVIEW                 LONG      DSNVIEW

Now in any member in that PDS if you place cursor on the file name and press PF4 key that file will be opened in edit mode.
Hello all,
I am asking on this old thread because is related to something I am trying to accomplish: To open on View / Edit a dataset or member from DSLIST panel.
Does anyone of you have the "DSNVIEW" clist?
I guess it is a REXX or CLIST placed on many companies, but not an IBM standard provided.

Thanks in advance

MMFC
Member
Posts: 3
Joined: Tue Sep 12, 2017 12:28 am

DSNVIEW CLIST - REXX

Post by MMFC » Fri Sep 22, 2017 2:00 am

Krishna wrote:Following info may be useful..

Open the jcl.. type KEYS command.
set PF4 command to DSNVIEW command.
It will work in all members in that PDS.

Code: Select all

Key    Definitions                Format   Labels
PF4     DSNVIEW                 LONG      DSNVIEW

Now in any member in that PDS if you place cursor on the file name and press PF4 key that file will be opened in edit mode.
Hello Krishna (or another forum member):
By coincidence, do you have the DSNVIEW CLIST / REXX?
I am trying to accomplish something similar. Looks like DSNVIEW is a non-standard command list that it is used in many companies. Thanks!!

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others