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

JCL calling REXX, REXX calls edit macro which accepts parame


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Jul 31, 2009 5:00 pm
Reply with quote

Hi,

Following is my rexx code. I will be calling this rexx from a JCL. The edit macro which i wrote accepts parameters and works accordingly.
Now, dataset opens says "string not found".
Where did i make the mistake, when passing the parameter or in the edit macro ?


Code:
/* REXX  *********************************/                 
/* MACRO STARTER  MACRO IS A SEPARATE PRG*/                 
/*************************REXX************/                 
/*DSN=HXSULL.QUERY.REPEXCP */                               
ADDRESS ISPEXEC                                             
  USER = USERID()                                           
  TRACE I                                                   
PARM = "SSID  INTERVAL_START"                               
"ISPEXEC VPUT (PARM) PROFILE"                               
"ISPEXEC EDIT DATASET('HXSULL.QUERY.REPEXCP') MACRO (MAC2)" 
EXIT                                                         



MAC2 macro
Code:
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"     
    "ISREDIT MACRO (HEADER)"               
                                           
/*  "ISREDIT TOP"*/                         
    "ISREDIT F ALL '------'"               
    "ISREDIT F SELECT"                     
    "ISREDIT (TOP) = CURSOR"               
    "ISREDIT LABEL .ZCSR = .TOP"           
                                           
    "ISREDIT F X'5E' ALL"                   
    "ISREDIT (BOTTOM) = CURSOR"             
     SELECT                                 
      WHEN TOP=BOTTOM THEN                 
      DO                                   
        "ISREDIT DELETE ALL .TOP .TOP"     
      END                                   
      OTHERWISE                             
      DO                                   
        "ISREDIT LABEL .ZCSR= .BOTTOM"     
        "ISREDIT DELETE ALL .TOP .BOTTOM"   
      END                                   
     END                                     
                                             
    "ISREDIT X ALL"                         
    "ISREDIT F ALL P'DSNE6==I'"             
    "ISREDIT DELETE ALL NX"                 
    "ISREDIT RESET"                         
                                             
    "ISREDIT ONLY '----+-----'"             
    "ISREDIT DELETE ALL NX"                 
    "ISREDIT ONLY "HEADER""                 
    "ISREDIT FLIP"                           
    "ISREDIT FIND FIRST "HEADER""           
    "ISREDIT DELETE ALL X"                   
    "ISREDIT RESET"                         
/*  "ISREDIT END" */                         
EXIT                                         


Sushanth
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Jul 31, 2009 5:12 pm
Reply with quote

You didn't read manual SC34-4819-07.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Jul 31, 2009 5:49 pm
Reply with quote

Prino,

Is the mistake in VPUT, manual says 'specifies one or more dialog variables'. What iam passing is not a diaglog variable. Its just a variable. So, ISPFEXEC is opening the dataset, and running macro till the parameter line. So, according to the macro no parameters are being passed. So, it says "STRING NOT FOUND". And, I can remove that VPUT line. Now, how am i gonna pass the parameter ?

A help would be helpful.

Sushanth
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Jul 31, 2009 6:18 pm
Reply with quote

Go and RTFM, SC34-4819-07, it explains everything!
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Jul 31, 2009 6:42 pm
Reply with quote

Code:
PARM(PARM)


Thank You, Got it.

Sushanth
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Sat Aug 01, 2009 1:53 am
Reply with quote

Hi Sushanth,
Apparently, you need a little bit more guidance.

You use VPUT to store a value into a "pool", then you have to retrieve it later by using a VGET.
If you don't use VGET then don't use VPUT.

You don't use the USER variable, you can throw it away too.

You have TRACE I in your rexx, so you must know what it does.
Use it in your macro too.

I don't see the "/* REXX */" a the beginning of the macro.

As you modify an edited file, you should terminate with an explicit "SAVE" or "CANCEL".
This will remove any doubt.

And what happens if the string is not found? You never check any RC.
I think you should..
BTW, when a string is not found, the message "string not found" shows. How weird.

ONLY is not a standard ISPF edit command. It is certainly a local macro.
(I bet it has x all followed by find all)

Once you've finished to RTFM this book recommended by prino, you should RTFM this one...
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Mon Aug 03, 2009 2:42 pm
Reply with quote

Thank you for your guidance MARSO.
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 -> CLIST & REXX

 


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