Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to use extract data from a cursor position

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
sunil sharma

New User


Joined: 23 Jun 2008
Posts: 2
Location: Chennai, India

PostPosted: Tue Sep 09, 2008 8:12 pm    Post subject: How to use extract data from a cursor position
Reply with quote

I want to edit a dataset from a jcl from a curser position. I am using the below code, but not able to do so.
Here (row,col) = CURSOR is used, but i am not getting the row and column number.

Code:

/*  REXX   */
Address ISREDIT                                                                 
"MACRO"                                                                         
Address ISPEXEC "CONTROL ERRORS RETURN"                                         
  /***********************************************/                             
  /*   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 ZB 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(',',data1,dsnstart)   /* look for comma at end of dsn */         
  If dsnend = 0 then do              /* no comma found               */         
    dsnend = Pos(' ',data1,dsnstart) /* 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(ISRZ001)"      /* 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          */         
  /**********************************/                                         
  /* BROWSE the data set            */                                         
  /**********************************/                                         
  dsn = Substr(data1,dsnstart,dsnend-dsnstart+1) /* extract dsn     */         
  dsn = Strip(Translate(dsn,"","'"))       /* remove quotes if used */         
  Address ISPEXEC "BROWSE DATASET('"dsn"')"                                     
  If RC <> 0 then Address ISPEXEC "SETMSG MSG("ZERRMSG")"                       
  "CURSOR = " row col /* put cursor back to last position        */             
  Exit 0                                             
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Sep 09, 2008 8:19 pm    Post subject:
Reply with quote

This is not a TSO exec, but an ISPF Edit macro. It should be invoked from within editor, without the TSO prefix.

O.
Back to top
View user's profile Send private message
sunil sharma

New User


Joined: 23 Jun 2008
Posts: 2
Location: Chennai, India

PostPosted: Tue Sep 09, 2008 8:23 pm    Post subject:
Reply with quote

Hi,
Thanks for your quick reply
Can you please tell me how to do that?
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2128
Location: Silicon Valley

PostPosted: Tue Sep 09, 2008 10:10 pm    Post subject: Reply to: How to use extract data from a cursor position
Reply with quote

Quote:
It should be invoked from within editor, without the TSO prefix.

Ofer's instruction seems pretty clear:
1. use ispf option 2 to edit the dataset
2. type memname in the command line. do not prefix with TSO
Back to top
View user's profile Send private message
rsshanmugam

New User


Joined: 08 Mar 2005
Posts: 62
Location: Basildon

PostPosted: Fri Feb 09, 2018 4:49 pm    Post subject:
Reply with quote

even though very old post. the code works like charm, thanks sunil sharma
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts To get the count of PDS data sets whi... Vignesh Sid JCL & VSAM 4 Fri Nov 30, 2018 8:38 pm
No new posts DB2 - loading data Joshua1066 DB2 5 Sun Nov 18, 2018 4:58 am
This topic is locked: you cannot edit posts or make replies. DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 3 Tue Nov 13, 2018 7:55 pm
No new posts Will this code extract 1 byte from fi... pkmurali CLIST & REXX 8 Sat Nov 10, 2018 11:13 pm
No new posts REFORMATTING WITH JFY CLOBBERING OUTP... speermb DFSORT/ICETOOL 12 Thu Nov 08, 2018 7:20 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us