IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need Help In Coding Rexx code


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jun 15, 2010 1:46 pm
Reply with quote

You may want to use CAPS(ON) on you input fields too, so that you don't have to check for 'y' and 'Y'.

There is a lot of typos in your posts. Try to copy and paste the text.
Use BBCode too, it makes it much easier for everybody.
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Tue Jun 15, 2010 4:07 pm
Reply with quote

Marso.. Thanks a lot.

Now panel definition look like below. Only thing is Message field is unprotected. I want make that field protected, as I want use this field only to send the user defined messages or any other meassages. Please guide me how to achive that
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Tue Jun 15, 2010 4:21 pm
Reply with quote

I achieved that by using below code in panel.

$MESSAGE --->+!Z


Is this is correct. Now the message field is protected. And I defined Z variable for the same in )INIT section.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Jun 15, 2010 7:38 pm
Reply with quote

Not bad for your first project. But your color scheme is not consistent with ISPF.
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Tue Jun 15, 2010 9:13 pm
Reply with quote

Thanks Pedro. I am trying to pass the dsn names to jcl. but it replacing the skelton with empty screen. I am not getting where I am doing wrong . Actually i have to pass user id also.. but first i am trying to pass atleast dataset names to the jcl. Please find the attched code and skelton and guide me where i am doing wrong
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jun 15, 2010 9:50 pm
Reply with quote

Hello,

Please refer to the posts Marso and Expat have made. . .

To show screen data, simply use copy/paste and the Code tag. Then Preview what you have to see it as it will appear to the forum.

Please re-post the last bits of info and i'll remove the .jpg images.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Jun 16, 2010 1:01 am
Reply with quote

Look at the ISPF Services manual and compare VGET SHARED with VGET PROFILE.
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Fri Jun 18, 2010 1:22 pm
Reply with quote

Hi Dick,

Please remove the jpg that I have attached. I am able to get the jcl thru rexx but facing problem in passing the dataset name to jcl skelton. Please find the below code and guide me how to proceed on this.

Code:
Panel code:

)ATTR                                                           
  # TYPE(TEXT) SKIP(ON)                                         
  $ TYPE(TEXT) SKIP(ON) INTENS(LOW) COLOR(YELLOW)               
  ! TYPE(INPUT) CAPS(ON) JUST(LEFT) PAD(NULLS) INTENS(LOW)     
  ¢ TYPE(OUTPUT) CAPS(ON) JUST(LEFT) PAD(' ')                   
)BODY WINDOW(74,18) EXPAND(\\)                                 
$                       CDL PAL Verification                   
%                                                               
%                                                               
%     1  Extract 6000 / CDL 2300                               
%     2  Extract 6000 / PAL 3700                               
%     3  Extract 6000 / CDL 2300 / PAL 3700                     
%                                                               
%    Please enter your option                  :!Z$             
%    Compare Invoice Y/N                       :!Z$             
%    Environment DEVL(D)/SYSI(S)/QA(Q)/PROD(P) :!Z$             
%    Extract file:!Z                                           $
%    PAL file    :!Z                                           $
%    CDL file    :!Z                                           $     
%                                                                   
%Message --->+!Z                                                 $<-
%                                                                   
%                                                                   
%                      <PF3>+EXIT, %<ENTER>+PROCESS                 
)INIT                                                               
 .ZVARS = '(OPTION INVOICE,ENVRN,INPUT1,INPUT2,INPUT3,EMSG)'         
 .CURSOR = 'OPTION'                                                 
)PROC                                                               
 VER(&OPTION,NB,LIST,1,2,3)                                         
 VER(&INVOICE,NB,LIST,Y,N)                                           
 VER(&ENVRN,NB,LIST,D,S,Q,P)                                         
 IF (&OPTION = 1)                                                   
    VER(&INPUT1,NB,DSNAME)                                           
    VER(&INPUT3,NB,DSNAME)                                           
 IF (&OPTION = 2)                                                   
    VER(&INPUT1,NB,DSNAME)                                           
    VER(&INPUT2,NB,DSNAME)
 IF (&OPTION = 3)         
    VER(&INPUT1,NB,DSNAME)
    VER(&INPUT2,NB,DSNAME)
    VER(&INPUT3,NB,DSNAME)
)END     


Code:
 Rexx cosde
/* rexx */                                                       
trace on                                                         
/* +++++++++++ TESTING ++++++++++++++ */                         
   panellib = 'tshrpd.p54gz6.rexx.panel'                         
   clistlib = 'tshrpd.p54gz6.rexx.clist'                         
trace on                                                         
address ISPEXEC                                                 
"control errors return"                                         
sysenv = sysvar('sysenv')                                       
sysuid = sysvar('sysuid')                                       
address TSO "ALTLIB ACTIVATE APPLICATION(EXEC) DSN('"clistlib"')"
if (rc ¬= 0) then do                                             
   say 'ALTLIB ACT failed, rc='rc                               
   exit 99                                                       
end                                                             
"LIBDEF ISPPLIB DATASET ID('"panellib"')"                       
 ispskel  = 'TSHRPD.P54GZ6.REXX.ISPSLIB'                         
"LIBDEF ISPSLIB DATASET ID('"ispskel"')"                         
/* ------------------------------------------------------------ */
ARG OPTION INVOICE ENVRN INPUT1 INPUT2 INPUT3 EMSG                 
   ADDRESS ISPEXEC                                                 
   EMSG = ''                                                       
   "DISPLAY PANEL(TEST1V)"                                         
   if rc \= 0 then exit                                           
                                                                   
   IF ZENVRN == 'D' & (SUBSTR(INPUT1,1,7) \= 'TSHRCI.') THEN       
   DO                                                             
      SAY 'DATASET NAME SHOULD START WITH TSHRCI'                 
      EXIT                                                         
   END                                                             
                                                                   
   "ispexec ftopen temp"                                           
   "ISPEXEC ftincl testjcl"                                       
   "ispexec ftclose"                                               
                                                                   
                                                                   
   ADDRESS ISPEXEC "EDIT DATASET ('"ISPSKEL"("TESTJCL")'"         
   ADDRESS TSO "FREE F(ISPFILE) " 
   ADDRESS ISPEXEC "REMPOP"       
                                   
exit                               
/* end rexx */                     


Jcl Skelton

Code:
//P54XXXX JOB (CMP01),'P54G73',                                 
//  CLASS=1,MSGCLASS=X,NOTIFY=&SYSUID                           
//JOBLIB DD DSN=TSHRPD.PAL.LOADLIB,DISP=SHR                     
//*************************************************************
//PS01    EXEC PGM=ITPCMP2,PARM=XX                             
//CDL      DD DSN=&INPUT3,                                     
//         DISP=SHR,DCB=BUFNO=30                               
//PAL      DD DSN=&INPUT2,                                     
//         DISP=SHR,DCB=BUFNO=30                               
//BILEXT   DD DSN=&INPUT1,                                     
//         DISP=SHR,DCB=BUFNO=30                               
//OUTREP   DD DSN=PSHRPD.PALCDL.REPORT,                         
//         DISP=NEW                                             
//SYSTSPRT DD  SYSOUT=*                                         
//SYSOUT   DD DSN=DUMMY                                         
//SYSPRINT DD  SYSOUT=*                                         
//SYSABOUT DD  SYSOUT=*                                       
//SYSDBOUT DD  SYSOUT=*                                       
//*----------------------------------------------------*       
//* SEND EMAIL WITH REPORT                             *       
//*----------------------------------------------------*       
//PS02    EXEC PGM=IKJEFT01,COND=(0,NE)                       
//SYSEXEC   DD DISP=SHR,DSN=SYS4.CLIST                         
//          DD DISP=SHR,DSN=PSHRPD.PROD.CNTLLIB               
//DATASET   DD DSN= PSHRPD.PALCDL.REPORT,                     
//             DISP=SHR                                       
//SYSPRINT  DD SYSOUT=*                                       
//SYSTSPRT  DD SYSOUT=*                                       
//SYSTSIN   DD  *                                             
  %XMITIP (USERID@NAMEDCO.MSX.MEDCOHEALTH.COM               - 
             EOBNOTICE@MEDCO.COM)                           - 
    NOMSG FILEDD (DATASET)                                  - 
    SUBJECT 'RE: PAL/CDL REPORT'                            - 
    FROM   MEDDEOBDEVTEAM@NAMEDCO.MSX.MEDCOHEALTH.COM       - 
    MSGT "PLEASE FIND ATTACHED PAL/CDL VERIFICATION REPORT"
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jun 18, 2010 2:16 pm
Reply with quote

Ho hum.
You are using a TEMPORARY outfile from your FT process, so why do you want to look at the ISPSLIB library.
Try this.

Code:
"ISPEXEC VGET (ZTEMPF,ZTEMPN)"           
"ISPEXEC EDIT DATASET('"STRIP(ZTEMPF)"')"
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Mon Jun 21, 2010 9:04 pm
Reply with quote

Is there any method in rexx which is similar to reference modification in cobol. I want to move option(1 or 2) and invoive(y or n) to PARM in jcl. how to achive that. I tried using substr, but I am getting spaces in parm field.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jun 21, 2010 9:25 pm
Reply with quote

Srinivasarangam,

debugging REXX scripts with TRACE ?R is almost easier than
any IDE on the toy machines.

you can enter commands, you can modify commands
for instance:

you have a substr which is moving spaces in the parm field
(other than the obvious, which is that you have not bothered to really learn how to use the substr command - which is the same as reference mod in cobol)

so, your substr command is picking up the wrong byte,
during a TRACE ?R run,
you will see the results of your substr command.
if it does not address the correct byte,
you have the opportunity to reenter the command, with a modification,
and execute that. then you will see what you have to change in your
script.

besides, you have no substr command in the rexx scripts that you have shown us.

and it is TRACE ?R , not TRACE ON............................
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jun 22, 2010 4:18 am
Reply with quote

Srinivasarangam,

another thing.

substr returns a value; you don't use it to move something somewhere.

say you have a variable - oldvar containing: 'abcefg'.

you want to have 'abcdefg'.

so;
oldvar = substr(oldvar,1,3) || 'd' || substr(oldvar,4,3)
oldvar will now have 'abcdefg'.

it does not work like the mid function of visual basic.
you have to concatenate - || - your sub-strings.

I apologize if I misslead you with my previous post.
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Tue Jun 22, 2010 11:21 am
Reply with quote

Dick Brenholtz ,

Ur suggestion and guidelines solved my problem.
Thank you very much
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jun 22, 2010 12:53 pm
Reply with quote

glad that I was able to help.
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Tue Jun 22, 2010 8:12 pm
Reply with quote

I am trying to pass the below from rexx code to jcl



Code:
Rexx Code:

EXTRA1 = '@NAMEDCO.MSX.MEDCOHEALTH.COM'         
UID = USERID()                                   
USER1 = UID                                     
USER2 = SUBSTR(USER1,1,6) || SUBSTR(EXTRA1,1,28)

jcl code
//SYSTSIN DD *
%XMITIP (&USER2 -
EOBNOTICE@MEDCO.COM) -

But I am facing problem in moving the above one. I think this becaue of the special charcter I used in the code. Could you please how to achive that
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Tue Jun 22, 2010 8:17 pm
Reply with quote

when I do trace i , I am finding that user2 is populated properly.. but the same is not coming to jcl(rexx invoked jcl). Please help me to move further
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Jun 23, 2010 6:03 am
Reply with quote

Quote:
I am finding that user2 is populated properly


Are you sure? Because you do not show how 1) how you assign a value to it and 2) how you get the parameter in rexx.

Please show more detail.

You may want to read the rexx reference manual. Read about the PARSE instruction.
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Mon Sep 06, 2010 12:48 pm
Reply with quote

Thank you all. My code is working successfully in production. I got many appriciation for completing tool successfully. Thank you for all your supprot.

Thank You Very Much....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top