Processing Array in Rexx

IBM's Command List programming language & Restructured Extended Executor
madrista
Posts: 2
Joined: Tue Nov 29, 2016 11:18 am
Skillset: JCL COBOL DB2 REXX
Referer: INTERNET

Processing Array in Rexx

Postby madrista » Tue Nov 29, 2016 11:27 am

HI ,
I am beginner in rexx, i need to search a string in data set. for that i have referred the data set using array. but i am unable to search string in the array .
please help me
Thanks in Advance ..

BillyBoyo
Global moderator
Posts: 3805
Joined: Tue Jan 25, 2011 12:02 am
Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
Referer: Google

Re: Processing Array in Rexx

Postby BillyBoyo » Tue Nov 29, 2016 12:43 pm

There are several ways. Surely you've read about some of them in the documentation? Or you've searched here? Or done a bit of search-engineing?

By "array" do you mean a stem variable? What do you mean by "string" in this context? When you say you've "referred the data set using array" you mean you've written one line of code, or more?

madrista
Posts: 2
Joined: Tue Nov 29, 2016 11:18 am
Skillset: JCL COBOL DB2 REXX
Referer: INTERNET

Re: Processing Array in Rexx

Postby madrista » Tue Nov 29, 2016 2:45 pm

Yes i have red the documents but i am unable to get what i want,
yes array mean stem variable im asking about, string is a word in the data set i would like to search.
my code is
"ALLOC F(INFILE) DSN(SAMPLE.REXX.PS) SHR REU"
"EXECIO * DISKR INFILE (FINIS STEM MYFILE.)"
"FREE F(INFILE)"

SO next i would like to search a word from the data set.
please guide me in this regard.
Thank you

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

Re: Processing Array in Rexx

Postby NicC » Tue Nov 29, 2016 7:49 pm

Read about the builtin functions especially those beginning WORD but also INDEX and POS.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

User avatar
Pedro
Posts: 687
Joined: Thu Jul 31, 2008 9:59 pm
Skillset: ISPF
Referer: google
Location: Silicon Valley

Re: Processing Array in Rexx

Postby Pedro » Tue Nov 29, 2016 10:35 pm

I think what you want is to execute the srchfor utility. Normally, this is ISPF option 3.14. You can submit a job similar to this:

Code: Select all

//MYPDS  EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'ANYC')
//NEWDD   DD   DISP=SHR,DSN=PEDRO.MY.PDS
//OUTDD   DD   SYSOUT=(H)                        
//SYSIN   DD *                                  
SRCHFOR  'XYZ'                                  
/*                                              

You can also use rexx to allocate the required DD names and invoke the ISRSUPC program.
Pedro Vera

  • Similar Topics
    Replies
    Views
    Last post