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
 

 

Problem with REXX code.

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

Active User


Joined: 10 Aug 2009
Posts: 158
Location: India

PostPosted: Wed Sep 29, 2010 4:49 pm    Post subject: Problem with REXX code.
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

Moderator Team Head


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

PostPosted: Wed Sep 29, 2010 5:02 pm    Post subject: Reply to: Problem with REXX code.
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: 158
Location: India

PostPosted: Wed Sep 29, 2010 5:18 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Sep 29, 2010 5:28 pm    Post subject: Reply to: Problem with REXX code.
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: 158
Location: India

PostPosted: Wed Sep 29, 2010 5:33 pm    Post subject:
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    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 Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


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