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

Submit a Job through Rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 85
Location: bangalore

PostPosted: Wed Jul 30, 2014 6:16 pm
Reply with quote

Hello , I am trying to write a rexx code , which will search a particular string from library. its like it will take string and library name to be searched from screen and submit the job through rexx.


I Want the LIBRARY_NAME and SEARCH_STRING to be replaced with the value read from screen input in below QUEUE Command

QUEUE'//NEWDD DD DSN=LIBRARY_NAME,'

QUEUE'SRCHFOR SEARCH_STRING'

if I hard code the values in above QUEUE command , it's working fine.
but I want the value should be read dynamically which take from screen and replace in the QUEUE command.



/*REXX*/

SAY "ENTER THE CHARACTER TO BE SEARCHED "
PULL SEARCH_STRING
SAY "ENTER THE LIBRARY NAME TO BE SEARCHED"
PULL LIBRARY_NAME
SAY "ENTER 'X' TO INDICATE END OF LIST"

DO UNTIL SEARCH_STRING='X'
IF SEARCH_STRING='X'
THEN
DO
SAY "END OF INPUT BY USER"
SAY "BYE" USERID()
END
ELSE
DO
SAY "SEARCHING FOR" SEARCH_STRING
CALL SEARCHING
END
END
EXIT
SEARCHING: PROCEDURE
QUEUE'//SEARCH JOB (CAKGVY,CH20),'
QUEUE'// NOTIFY=&SYSUID,'
QUEUE'// CLASS=X,'
QUEUE'// MSGCLASS=Y'
QUEUE'//*--------------------------------------------------------------'
QUEUE'//JS010 EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'ANYC')'
QUEUE'//*--------------------------------------------------------------'
QUEUE'//NEWDD DD DSN=LIBRARY_NAME,'
QUEUE'// DISP=(SHR,KEEP,KEEP)'
QUEUE'//SYSIN DD *'
QUEUE'SRCHFOR SEARCH_STRING'
QUEUE'//OUTDD DD SYSOUT=*'
QUEUE'//SYSPRINT DD SYSOUT=*'
QUEUE'//SYSUDUMP DD SYSOUT=*'
QUEUE'//'
"SUBMIT *"
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Jul 30, 2014 7:09 pm
Reply with quote

If they are within quotes, it is a constant. If they are outside of quotes, they are a variable. Try this:
Code:
QUEUE '//NEWDD DD DSN='LIBRARY_NAME','
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Jul 30, 2014 7:15 pm
Reply with quote

I would always recommend the use of file tailoring rather than inbuilt JCL within a REXX EXEC.
Back to top
View user's profile Send private message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 85
Location: bangalore

PostPosted: Wed Jul 30, 2014 7:41 pm
Reply with quote

if they are within quotes, it is a constant. If they are outside of quotes, they are a variable. Try this:
Code:
QUEUE '//NEWDD DD DSN='LIBRARY_NAME','

I tried this but its not working.its unable to replace the library names.

the submitted jcl getting error

//SEARCH JOB (xxxxx,CH20),
// NOTIFY=&SYSUID,
// CLASS=X,
// MSGCLASS=Y
-------------------
//JS010 EXEC PGM=ISRSUPC,PARM=(SRCHCMP,ANYC)
//*--------------------------------------------------------------
//NEWDD DD DSN=LIBRARY_NAME,
// DISP=(SHR,KEEP,KEEP)
//SYSIN DD *
SRCHFOR SEARCH_STRING
//OUTDD DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Jul 30, 2014 7:57 pm
Reply with quote

Have you used the REXX TRACE facility ?
Back to top
View user's profile Send private message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 85
Location: bangalore

PostPosted: Wed Jul 30, 2014 8:05 pm
Reply with quote

YES. I am using the REXX Trace

here is the information. it is unable to replace the Library names .
Code:


        >L>       "//NEWDD  DD DSN="                                           
        >L>       "LIBRARY_NAME"                                               
        >O>       "//NEWDD  DD DSN=LIBRARY_NAME"                               
        >L>       "QUEUE"                                                       
        >O>       "//NEWDD  DD DSN=LIBRARY_NAME QUEUE"                         
        >L>       "//          DISP=(SHR,KEEP,KEEP)"                           
        >O>       "//NEWDD  DD DSN=LIBRARY_NAME QUEUE//          DISP=(SHR,KEEP,
 KEEP)"                                                                         
     33 *-*     QUEUE'//SYSIN DD *'                                             
        >L>       "//SYSIN DD *"                                               
     34 *-*     QUEUE'SRCHFOR' SEARCH_STRING                                   
        >L>       "SRCHFOR"                                                     
        >L>       "SEARCH_STRING"                                               
        >O>       "SRCHFOR SEARCH_STRING"                                       
     35 *-*     QUEUE'//OUTDD     DD SYSOUT=*'                                 
        >L>       "//OUTDD     DD SYSOUT=*"                                     
     36 *-*     QUEUE'//SYSPRINT  DD SYSOUT=*'                                 
        >L>       "//SYSPRINT  DD SYSOUT=*"                                     
     37 *-*     QUEUE'//SYSUDUMP  DD SYSOUT=*'                                 
        >L>       "//SYSUDUMP  DD SYSOUT=*"                                     
     38 *-*     QUEUE'//'                                                       
        >L>       "//"                                                         
     39 *-*     "SUBMIT *"                                                     
        >L>       "SUBMIT *"
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Jul 30, 2014 8:11 pm
Reply with quote

I suggest reading up on passing variables to an internal routine in the same REXX.
Especially as you have declared SEARCHING as a PROCEDURE.

I found a suggested resolution on google in less than a minute

And please learn to use the code tags !!!!!
Back to top
View user's profile Send private message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 85
Location: bangalore

PostPosted: Thu Jul 31, 2014 2:30 pm
Reply with quote

I removed the PROCEDURE from SEARCH routine. Now is working fine. Thank you
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1349
Location: Israel

PostPosted: Thu Jul 31, 2014 4:59 pm
Reply with quote

Is there something wrong with option 3.14 ?
Code:
 14 Search-For  Search data sets for strings of data          (Standard Dialog)
 15 Search-ForE Search data sets for strings of data Extended (Extended Dialog)

or are you just practicing your REXX skills?
Back to top
View user's profile Send private message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 85
Location: bangalore

PostPosted: Thu Jul 31, 2014 5:19 pm
Reply with quote

Just Practicing how to submit a job through rexx by Reading input from user.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 756
Location: Pennsylvania

PostPosted: Thu Jul 31, 2014 5:33 pm
Reply with quote

Quote:
Just Practicing how to submit a job through rexx by Reading input from user.


Practice File Tailoring instead. In my opinion, it is far better than the method you are using.

I use it in hundreds of applications. Rexx built JCL, almost never. Only in applications that were given to me.
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
This topic is locked: you cannot edit posts or make replies. REXX to find /* Define and write the ... CLIST & REXX 5
No new posts How to submit multiple jobs with parm... JCL & VSAM 3
No new posts rexx pgm to create multiple ps file IBM Tools 7
No new posts Mainframe batch Job or REXX to get VT... CLIST & REXX 7
No new posts calling OMEGAMON from REXX CLIST & REXX 3
Search our Forums:

Back to Top