View previous topic :: View next topic
|
Author |
Message |
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I would always recommend the use of file tailoring rather than inbuilt JCL within a REXX EXEC. |
|
Back to top |
|
|
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Have you used the REXX TRACE facility ? |
|
Back to top |
|
|
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
I removed the PROCEDURE from SEARCH routine. Now is working fine. Thank you |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
Just Practicing how to submit a job through rexx by Reading input from user. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
|