Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Submit a Job through Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 81
Location: bangalore

PostPosted: Wed Jul 30, 2014 6:16 pm    Post subject: Submit a Job through Rexx
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

Senior Member


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

PostPosted: Wed Jul 30, 2014 7:09 pm    Post subject: Reply to: Submit a Job through Rexx
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 30, 2014 7:15 pm    Post subject:
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: 81
Location: bangalore

PostPosted: Wed Jul 30, 2014 7:41 pm    Post subject: Reply to: Submit a Job through Rexx
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 30, 2014 7:57 pm    Post subject:
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: 81
Location: bangalore

PostPosted: Wed Jul 30, 2014 8:05 pm    Post subject: Reply to: Submit a Job through Rexx
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 30, 2014 8:11 pm    Post subject:
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: 81
Location: bangalore

PostPosted: Thu Jul 31, 2014 2:30 pm    Post subject: Reply to: Submit a Job through Rexx
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: 1218
Location: Israel

PostPosted: Thu Jul 31, 2014 4:59 pm    Post subject: Reply to: Submit a Job through Rexx
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: 81
Location: bangalore

PostPosted: Thu Jul 31, 2014 5:19 pm    Post subject: Reply to: Submit a Job through Rexx
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: 645
Location: Pennsylvania

PostPosted: Thu Jul 31, 2014 5:33 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us