MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Open a member from differnet PDS

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Apr 30, 2009 8:42 am    Post subject: Open a member from differnet PDS Reply with quote

Hi All,

I have a reqiurement where based on the parameter passed i need to open a member from two different libraries. Take for example i have following JCL

//SVSAPID JOB (,2468),'test',
// CLASS=F,MSGCLASS=X,
// TIME=1440,NOTIFY=&SYSUID
//JSTN0010 EXEC CONRCT,
// CARD01='TEST.CARD',
// MEM1='HOSTBA'

when i pass a parameter from command & keep the cursor on HOSTBA' and hit enter .If the parameter is "P" then it should open the member HOSTBA from PROD.CARD and if parameter value is "T" it should open the member HOSTBA in EDIT mode from TEST.CARD library & HOSTBA is will be present in both libraries..

Could anyone please give me a rexx code .

Thanks,
Siva
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Apr 30, 2009 9:26 am    Post subject: Reply with quote

use ARG to pick up your T or P
use CURSOR to determine the line and column position of the cursor
use LINE to input the data on the cursor'd line
use the column position to find your member name
build your pds name
invoke the edit session on the member
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Mon May 04, 2009 12:04 pm    Post subject: Reply with quote

And check with your systems support people about the advisability of using TIME=1440 on JOB statements.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Tue May 12, 2009 1:59 am    Post subject: Reply with quote

dbzTHEdinosauer,

Thanks for help. i have written the macro, but i am facing some problems.

Code:


"ISREDIT MACRO"                             
ISPEXEC "CONTROL ERRORS RETURN"             
"ISREDIT (BRWBLINE,  BRWBCOL) = CURSOR"     
"ISREDIT (BRWLINE) = LINE" BRWBLINE 

QB = INDEX(BRWLINE,'MEM')         
IF QB > 0 THEN DO                 
  CALL SEECARD                     
  EXIT                             
END                               
       
SEECARD:

BRWLINE = SUBSTR(BRWLINE, QB+5, 14)         
PARSE VAR BRWLINE ONE TWO                   
ONE=STRIP(ONE)                               
ONE=STRIP(ONE,B,'.')                         
ONE=STRIP(ONE,B,"'")                         
                         

SAY ' PLEASE ENTER OUR OPTION '   
PULL OPTION                       


IF OPTION = 'E' THEN                                               
   DO
    'ISREDIT F "CARD01" FIRST'                                             
    'ISREDIT (LINE1, COL1) = CURSOR'                                       
    'ISREDIT (LINE1) = LINE' LINE1                                         

       LP1 = LASTPOS(",",LINE1)                                               
       LP2 = LASTPOS("=",LINE1)                                               
       LP3 = LP1 - LP2                                                         

       LINE2 = SUBSTR(LINE1,LP2+1,LP3)                                         
       LINE2 = STRIP(LINE2,B,",")                                             
       LINE2 = STRIP(LINE2,B,"'")     
                                       
    "ISPEXEC EDIT DATASET('LINE2("ONE")')"   

        SAY "ZERRSM : " ZERRSM
        SAY "ZERRLM : " ZERRLM                                   

   END                                           

IF OPTION = 'V' THEN DO                         
   DO
                                                   
    'ISREDIT F "CARD01" FIRST'                         
    'ISREDIT (LINE1, COL1) = CURSOR'                   
    'ISREDIT (LINE1) = LINE' LINE1                     

     LP1 = LASTPOS(",",LINE1)                           
     LP2 = LASTPOS("=",LINE1)                           
     LP3 = LP1 - LP2                                   

     LINE2 = SUBSTR(LINE1,LP2+1,LP3)                   
     LINE2 = STRIP(LINE2,B,",")                         
     LINE2 = STRIP(LINE2,B,"'")                         
               
    "ISPEXEC VIEW DATASET('LINE2("ONE")')"                 

     SAY "ZERRSM : " ZERRSM                       
     SAY "ZERRLM : " ZERRLM                       

   END





i am not able to substitue the line2 value in "ISPEXEC VIEW DATASET('LINE2("ONE")')" . When i display the error message it says dataset is not cataloged.


Code:


ZERRSM :  Data set not cataloged               
ZERRLM :  'LINE2' was not found in catalog.   



please let me know how to substitue the value of LINE2 in the edit or view session.

Thanks,
Siva
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue May 12, 2009 5:02 am    Post subject: Reply with quote

something along the lines of:
Code:
"ISPEXEC EDIT DATASET('"LINE2"("ONE")')"   


get into the habit of using
Code:
TRACE ?R

that will help you debug your REXX Scripts.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Wed May 13, 2009 3:25 am    Post subject: Reply with quote

Nice to see that you have made a good effort at coding it yourself.

Here's a piece of my own code that was almost the same as your requirement, so I have adapted it.

To use it, type macroname 1 2 on the command line and place the cursor on the required line.
I have coded it so that the parameters are non positional. Defaults are BROWSE and TEST.DATA.SET
so, if you just use macroname then it will browse the member from TEST

Code:

"ISREDIT MACRO (TYP LVL)"
"ISPEXEC CONTROL ERRORS RETURN"
UPPER TYP LVL
IF TYP = 'P' | LVL = 'P'
  THEN DSN = 'PROD.DATA.SET'
  ELSE DSN = 'TEST.DATA.SET'
SELECT
  WHEN LVL = 'B' THEN ACT = 'BROWSE'
  WHEN LVL = 'V' THEN ACT = 'VIEW'
  WHEN LVL = 'E' THEN ACT = 'EDIT'
  WHEN TYP = 'B' THEN ACT = 'BROWSE'
  WHEN TYP = 'V' THEN ACT = 'VIEW'
  WHEN TYP = 'E' THEN ACT = 'EDIT'
  OTHERWISE ACT = 'BROWSE'
END
"ISREDIT (CRSLINE) = "CURSOR
"ISREDIT (INDATA) = LINE " CRSLINE
INDATA = TRANSLATE(INDATA," ",",='")
PX = WORDPOS('MEM1',INDATA)
IF PX > 0 THEN DO
  MEMB = WORD(INDATA,PX+1)
  EDMEM = DSN||"("||MEMB||")"
  "ISPEXEC" ACT "DATASET('"EDMEM"')"
END
EXIT

_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group