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

Problem with REXX code.


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 184
Location: India

PostPosted: Wed Sep 29, 2010 4:49 pm
Reply with quote

I've written a small rexx exec to generate JCL. JCL is to search a string in multiple PS files. Every thing is working fine except below REXX statement.

Code:

QUEUE 'SRCHFOR  '''SIN0''','SIN1':'SIN2


Here SIN0 is search string, SIN1 is starting position and SIN2 is end position.

Expected output is
Code:

SRCHFOR  '40',22:23


But I am getting as
Code:

SRCHFOR  '40


I tried with string concatenation also.

Could you please let me know where and what change I need to do to my code?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Sep 29, 2010 5:02 pm
Reply with quote

I just tested your posted code and it works fine.

Please post a runtime TRACE. The only thing I can think of off-hand is that SIN0 is a very large variable and you're truncating the actual output.
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 184
Location: India

PostPosted: Wed Sep 29, 2010 5:18 pm
Reply with quote

Hi Kevin,

Please find my rexx code and batch jcl used to execute rexx below. I have removed some credentials.

REXX Code:
Code:

/*REXX*/
TRACE ?R
FLAG=1
TODAY=DATE('S')

Say TODAY

ADDRESS TSO
"EXECIO * DISKR INFILE(FINIS STEM TST."
"EXECIO * DISKR SYSIN (FINIS STEM SIN."

If TST.0=0 Then EXIT

                      /* SUBMISSION OF THE MAIN JOB*/
QUEUE '//'USERID()'D  JOB 00000000,'
QUEUE '//         ''MODEL REG'',MSGCLASS=A,CLASS=A,NOTIFY=&SYSUID'
QUEUE '//**********************************************************/'
QUEUE '//* JCL FUNCTION:                                          */'
QUEUE '//* 1. SEARCHS FOR MULTIPLE STRINGS IN GIVEN POSITIONS     */'
QUEUE '//**********************************************************/'
QUEUE '//SEARCH  EXEC PGM=ISRSUPC,'
QUEUE '//            PARM=(SRCHCMP,''ANYC'',IDPFX,XREF)'
QUEUE '//NEWDD  DD DISP=SHR,DSN='substr(TST.1,10,29)

Do in=2 to TST.0
QUEUE '//       DD DISP=SHR,DSN='substr(TST.in,10,29)
End

QUEUE '//       DD DISP=SHR,DSN='
QUEUE '//**'
QUEUE '//OUTDD  DD DSN=PWSX.<userid>.LIST.PS9,DISP=(MOD,CATLG,)'
QUEUE '//SYSIN  DD *'

Do j=3 to SIN.0
QUEUE "SRCHFOR '"SIN.j"',"SIN.1":"SIN.2
/*QUEUE 'SRCHFOR  '''SIN.j''','SIN.1':'SIN.2*/
End

QUEUE '//**'
"EXECIO" QUEUED()" DISKW OUTFILE(FINIS"
Exit


Batch Jcl:

Code:

//STEP1 EXEC PGM=IKJEFT01,PARM='%ODEJCLRX'
//SYSEXEC  DD  DSN=<prefix>.<userid>.REXXLIB,DISP=SHR
//SYSPRINT DD  SYSOUT=*
//SYSTSPRT DD  SYSOUT=*
//INFILE   DD  DISP=SHR,DSN=<prefix>.<userid>.DATASET1
//OUTFILE  DD  DSN=<prefix>.<userid>.DATASET1.JCL,
//             DISP=(NEW,CATLG,DELETE),UNIT=DISK,
//             DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SYSTSIN  DD  DUMMY
//SYSIN    DD  *
22
23
40
44
65
79
92
97
98
/*


When I checked with TRACE option I got following output.

Code:

36 *-*  /*QUEUE 'SRCHFOR  '''SIN.j''','SIN.1':'SIN.2*/
37 *-* End
34 *-* Do j=3 to SIN.0
35 *-*  QUEUE "SRCHFOR '"SIN.j"',"SIN.1":"SIN.2
   >>>    "SRCHFOR '92
                                                   :23


Could you please suggest me where I am doing wrong?

Thanks!
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Sep 29, 2010 5:28 pm
Reply with quote

You need to remove the unneeded blanks from the "SIN.j" variable (STRIP, PARSE, SUBSTR, SPACE) or make the output LRECL longer to avoid the truncation.
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 184
Location: India

PostPosted: Wed Sep 29, 2010 5:33 pm
Reply with quote

All of you thank you very much.

I got the problem and issue resolved with STRIP.

Thanks again.
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