View previous topic :: View next topic
|
Author |
Message |
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
Hello All,
Requirement: I have 10 members in a dataset which contains different types of content in those 10 members. I would like to browse that dataset and write to another file if any member contains specific strings. I want to browse the entire member and in entire dataset.
If any through shed some light, it will great help to me.
Thanks,
Srini |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
I'm not sure what is your exact requirement...
- To search for a string in a PDS you can invoke SUPERC from within REXX, then read the output.
- To browse a dataset (sequential or a PDS member) from within REXX, you can use the ISPF service BROWSE.
O. |
|
Back to top |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
we can use ISPF servies from rexx, but it will be helpful for me if you provide me sort of sample code.
I have 10 members in dataset. Each member i have to copy around 10 lines to another file. Like that i want to collect those 10 lines from each member in a dataset and copy to another file |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
we can use ISPF servies from rexx, but it will be helpful for me if you provide me sort of sample code. |
I am sure that Ofer will give you a very competitive rate for his time coding and testing.
How do you decide which lines that you want to copy from each member ?
Does each member have a corresponding output dataset, or will all extracts go into one datatset ?
By browse a dataset / member, do you mean to open the dataset / member on your screen and manually search for strings, or do you want an ISPF edit macro to find the strings for you ? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
In this case, where only sample is needed, the fine manual will be sufficient. There are lots of examples in it.
O. |
|
Back to top |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
Few lines of code in every member should go to only one output file.
For me it doesn't matter whether rexx browse the dataset or edit it. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
what are the rules for extracting the lines ?? |
|
Back to top |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
the lines are like a assigning value to variables.
As an example : CMPCLI1 = CLIT.. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Nothing that a simple SRCHFOR wouldn' t be able to do |
|
Back to top |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
If the search string is constant then we can for 3.14 but are you saying the same. SRCHFOR? If it is different please let me know the syntax |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
SRCHFOR = 3.14 = SUPERC = ISRSUPC
O. |
|
Back to top |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
might be my fault that not able to clear my question.
I am not going search only one string. secondly each line is different in member itself and even with other members as well.
pls let me know if my question not clear |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Well, at least for me it is not clear...
O. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
why not submit a batch job
Code: |
000002 //SEARCH EXEC PGM=ISRSUPC,
000003 // PARM=(SRCHCMP,
000004 // '')
000005 //NEWDD DD DSN=Your.pds.dataset,
000006 // DISP=SHR
000007 //OUTDD DD SYSOUT=(A)
000008 //SYSIN DD *
000009 SRCHFOR 'STRING1',WORD
000010 SRCHFOR 'STRING2',PREFIX
000011 SRCHFOR 'STRING3'
...... add as many as you need
|
|
|
Back to top |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
Thanks much. I guess it's working. my problem not solved 100% but I got other with your suggestion.
Thank you very much |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I guess it's working. my problem not solved 100% |
If you take some time and show good examples of what you "have" and what you "want" your success rate will get closer to 100%.
You have provided very little to work with. |
|
Back to top |
|
|
cappucino
New User
Joined: 26 Nov 2007 Posts: 5 Location: chennai
|
|
|
|
Dear friends, I have a requirement in Rexx. I need to read all members in a PDS which is starting with R and the member should be of 4 characters only.(e.g., RAAB, RAAC, etc.,) And, in each of those members, there will be one string say, DEST=(RMT09001). I need to copy the 8 characters RMT09001 and write in to a PS file the member name and the value in it(e.g., RAAB RMT09001
RAAC RMT09002 etc.,)?
. Could any one please help me out. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
the fastest thing would be to run a search for saving the result to a dataset
and then write a small rexx to cleanup things |
|
Back to top |
|
|
cappucino
New User
Joined: 26 Nov 2007 Posts: 5 Location: chennai
|
|
|
|
But that file needs to be given as input to another program. In a single jcl, that has to be executed sequentially. I need that REXX to be executed at each and every time of the job execution. Could u plz provide the REXX code for the same? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
Could u plz provide the REXX code for the same? |
My current rate for REXX code, test and documentation is 600 euro per day, but I am sure that you will get lower quotes for your requirement if you shop around. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
But that file needs to be given as input to another program.
|
one of the reasons I like reading these forums is that so often someone displays the same behaviour as my stubborn, know-it-all, scared-of-anything-new, 3rd ex-mother-in-law.
cappucino,
if you do a background search (3.12)(a search step in your job) with IDPFX as a parm,
any hits from your search criteria will have the program name on the same line (as apposed to normal which would have the program name on a separate line preceding the 'hit' line. complicates parseing)
now, since you are begging for rexx code, it is assumed you are new, and trying to teach you how to use the LMM... api's, would be a PITB. Let the background search (3.12 in batch mode) find your hits. Then you only need to parse the output. disregard any program names not meeting your criteria and parse the line looking for the search-key and write it to a ps.
that would be two steps in a job.
1). the jcl for the search you can generate from the 3.12 screen and save to include in your job.
2).The jcl to run your rexx step in batch you can obtain from your systems people.
I can only assume you have the jcl for the subsequent steps. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
PITB ...
is it a newer/stronger/more_annoying release/version of PITA |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Anything you can do in batch, you can do with rexx. Use ALLOCATE instructions instead of JCL dd statements. Use CALL command instead of EXEC PGM= statement. Specify the same parms. The result should be the same.
Your rexx should:
1. use LISTDS 'my.pds' MEMBERS command, trap the output, save any member names that match your naming convention.
2. call Search For utility. See ISPF option 3.14 and select 'batch execution mode', and on the second panelo select 'Edit JCL before submit' for format of the SYSIN statements. You should have SRCHFOR statement and perhaps a few SELECT statements.
3. read the OUTDD file created by Search For and build the output in the format that you want. |
|
Back to top |
|
|
|