×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Find pds member searching a datset name

Find pds member searching a datset name

Find pds member searching a datset name

(OP)
I need to translate the srchfor in rexx language like this job :

//SEARCH EXEC PGM=ISRSUPC,
// PARM=(SRCHCMP,ANYC,IDPFX,NOPRTCC)
//NEWDD DD DSN=my.input.dataset,DISP=SHR
//OUTDD DD SYSOUT=A
//SYSIN DD *
SRCHFOR 'vbporodk.std.datak'
/*

And I have to get the name of the member found in a variable.

RE: Find pds member searching a datset name

I do not know exactly what you are asking. What do you mean by:

Quote:

I have to get the name of the member found in a variable
?
Please give an example.


Nic

RE: Find pds member searching a datset name

(OP)
hi Nic,
it's for a delete define (idcams) as ==> //sysin dd dsn=my.input.dataset(&mbdef)
I have to retrieve the name of the member as a variable not in a sysout or output file as in the JCL as above

RE: Find pds member searching a datset name

You can run your SRCHFOR in a Rexx program but you still need to process the sysout to extract the information that you want. Any program I may have had to do such a thing is, if I still have it at all, sitting on a hard drive that is dead.


Nic

RE: Find pds member searching a datset name

(OP)
Hi Nic,

I have a problem with ==> queue "Srchfor 'My DataSet ' " This way it works but when I want to put a variable it doesn't work anymore:
ex : file = 'my.dataset'
queue "srchfor 'file'" ==> not work

RE: Find pds member searching a datset name

As dsn is a variable it must be outside of the string thus

CODE -->

"srchfor '"dsn"'" 
If you do not need to quote the data set name (it is a data set not a 'file') then simply:

CODE

"srchfor "dsn 


Nic

RE: Find pds member searching a datset name

(OP)
Thank you for your answer NIc
On the other hand when I execute only the part to find the member it works very well but when I insert in the whole procedure the variable is not translated?

RE: Find pds member searching a datset name

That is so blurred that I can almost not read it. Could you not simply have cut and pasted it using the code tags (they are invoked using the button between what looks like a thinking man and a gift wrapped box)?
I see your superc ran with an RC of 16. What messages did it produce? In particular, what data set(s) did it think it was trying to read?


Nic

RE: Find pds member searching a datset name

(OP)
Hi Nic,


you can open with paint software with 200% of view.

Sorry for the poor quality of my trace result.
In fact my variable ICSOR (name of the VSAM file) comes from an entry of an area under ISPF that I retrieve and then I search for the member where his delete define is located and I retrieve that member name to later be able to build my JCL.

For you what's wrong in this :
"ALLOC F(INPUT) DA(‘VBPRDK.SRC.PRD’) SHR REU"
"ALLOC F(OUTDD) NEW REU UNIT(VIO) SP(5,5) CYLINDERS"
"ALLOC F(SYSIN) NEW REU UNIT(VIO) RECFM(F B) LRECL(80)"
FICS = FICSOR
say 'Fics : ' FICS <======  value ok I see the file name of vsam
QUEUE "SRCHFOR '"FICS"'" <============ not translated
"EXECIO "QUEUED()" DISKW SYSIN (FINIS"
"CALL *(ISRSUPC) 'SRCHCMP,ANYC'"
"EXECIO * DISKR OUTDD (STEM SUPC. FINIS"
DO I = 1 TO SUPC.0
PARSE VAR SUPC.I WD1 WD2 WD3 WD4 .
IF WD2 = '---------' &,
WD3 = 'STRING(S)' &,
WD4 = 'FOUND' THEN
DO
/*-------------------------------------------------------- */
/* test member delete define */
/*-------------------------------------------------------- */
MEMBDEL = "'"VBPRDK.SRC.PRD’"(WD1)'" <== value of WD1 is empty
ztst3 = sysdsn(MEMBDEL)
if CODERR = 0 then do
if ztst3 /= "OK" then do
CODERR = 1
MESSERR1 = "Update impossible member not found"
end
end
END
END

RE: Find pds member searching a datset name

Hi,
I have zero experience with REXX on mainframe, but on other platforms (iSeries, Windows, Linux).
If I want to execute the system command, then first I assemble it from variables into one string.
Then I can look into that string (with SAY) and try it eventually interactivelly if it works.
Finally, if it works I fire it from REXX.

So in your case you say that on the command line this works for you:

CODE

queue "Srchfor 'My_DataSet'" 

When I look into your script, it seems that your dataset name is in the variable FICS
So I would try following

CODE

/* create command */
my_command = 'queue "SRCHFOR '''||FICS||'''"'
/* look at the command */
say "executing: "||my_command
/* execute the command */
my_command 

RE: Find pds member searching a datset name

Agree with mikrom - you need to get FICS outside of quotes so that Rexx can substitute its contents into the string that you are creating. If it is inside quotes then it is treated as a literal, not a variable. This will probably be the same for WD1.

But...I transferred your code to my editor and it looks as though the quotes all match up correctly. I did not use QUEUE on the mainframe, although I am now using it on my PCs. The way I would have done this is:

CODE

fics = "'"fics"'"   /* quotes the data set name */
myrec1 = "srchfor "fics /* creates the command string */
"EXECIO 1 DISKW SYSIN(STEM myrec FINIS" 

Use TRACE R or TRACE I or, if running interactively, ?R or ?I. By using the ? you can step through the code and when you hit an error you can either enter code to fix the error or enter 'exit' without the quotes to quit the run.


Nic

RE: Find pds member searching a datset name

does the command SAY work in REXX on mainframe ?

RE: Find pds member searching a datset name

(OP)
yes very well, you have an example on the attached trace.

if I execute this part only, it works fine I have the value in wd1 but not with the whole procedure


"ALLOC F(INPUT) DA(‘VBPRDK.SRC.PRD’) SHR REU"
"ALLOC F(OUTDD) NEW REU UNIT(VIO) SP(5,5) CYLINDERS"
"ALLOC F(SYSIN) NEW REU UNIT(VIO) RECFM(F B) LRECL(80)"
FICS = FICSOR
say 'Fics : ' FICS <======  value ok I see the file name of vsam
QUEUE "SRCHFOR '"FICS"'" <============ not translated
"EXECIO "QUEUED()" DISKW SYSIN (FINIS"
"CALL *(ISRSUPC) 'SRCHCMP,ANYC'"
"EXECIO * DISKR OUTDD (STEM SUPC. FINIS"
DO I = 1 TO SUPC.0
PARSE VAR SUPC.I WD1 WD2 WD3 WD4 .
IF WD2 = '---------' &,
WD3 = 'STRING(S)' &,
WD4 = 'FOUND' THEN
DO

RE: Find pds member searching a datset name

Can you put a TRACE I before the FICS = FICSOR line and a TRACE OFF after the EXECIO * DISKR.... line and cut and paste the output.


Nic

RE: Find pds member searching a datset name

(OP)
Hi Nic,
I think the problem comes from the RC (16) at the SRCHFOR, if it's a run-time problem when I call ISRSUPC, what would be the permission to set up under RACF?

RE: Find pds member searching a datset name

If you already have RACF access to that data set then probably nothing more is needed but check with your RACF admin/TSO admin. Sometimes what you are allowed to do in foreground is restricted in background and vice versa.
What messages are you getting (this was requested last week!)?
Still need the trace.


Nic

RE: Find pds member searching a datset name

(OP)

RE: Find pds member searching a datset name

(OP)
that's why I think the member is not found

RE: Find pds member searching a datset name

Difficult to tell from your screen shots. A simple cut and paste would be better instead of 'Prt Sc'.
It looks as though superc was invoked OK but it would be better, until you get it working OK, to write the SYSPRINT to file rather than having it trapped.

Also, a better way to find "string(s) found" is to use the 'POS' function:

CODE

col = pos("string to find", string_to_look_in) 
If col is not zero then the string has been found starting at column col. No need to 'PARSE' and have the convoluted 'IF' statement.


Nic

RE: Find pds member searching a datset name

(OP)
Hi Nic,

After the tests due to rc (16) (RACF or Prefix), I probably have a prefix problem, how can we do to avoid this error code?
for you is it the translation of this error code?
It's the same with "address ispexec... ISRSUPC.
See this old trace attached.

Thank you for your investment for this problem.




RE: Find pds member searching a datset name

Once agsin that has done nothing to help. Unless you can cut and paste into your reply using the code tags then I cannot help.

Example

CODE

This folder contains all the files required for the passwo
maintenance and query of passwords. Passwords can be gener
and queried. The passwords are contained in a database acc
can be backed up and recovered using SQLite functions. Oth
Rexx. 
The above was cut from a screen, pasted here, highlighted and the code tag button clicked. Simple.


Nic

RE: Find pds member searching a datset name

@LLuc,
when you paste your code, then paste it between the tags:
[code] 
...
[/code] 

RE: Find pds member searching a datset name

(OP)
Hi Mikrom,

Sorry, but i do not understand how you can set these parameters because Rexx does not recognize them ?

RE: Find pds member searching a datset name

They are nothing to do with Rexx but how to present data in your posts in this forum.


Nic

RE: Find pds member searching a datset name

Are you tring to run SRCHFOR against VBPRDK.SRC.PRD? If so, you should be allocating that PDS/library to NEWDD not INPUT.

This is the JCL created when I do a search on my JCL library:

CODE --> JCL

//NICCJOB  JOB (12345678),NICC,MSGCLASS=H,     
//        MSGLEVEL=(1,1),CLASS=A,NOTIFY=&SYSUID
//SEARCH  EXEC PGM=ISRSUPC,                    
//            PARM=(SRCHCMP,                   
//            'ANYC')                          
//NEWDD  DD DSN=NICC.JCL.CNTL,                 
//          DISP=SHR                           
//OUTDD  DD SYSOUT=(A)                         
//SYSIN  DD *                                  
SRCHFOR  'NICC'                                
/* 

Nic

RE: Find pds member searching a datset name

(OP)
Hi Nic,

I just saw my error actually an unforeseen changes changed the name of the ddname from NEWDD to input, this fixes the RC (16) But now I realize that I am often stuck in the system by other batch jobs
WWe would have to find another way to retrieve the member's name without having to be blocked .

Thank you have find the problem for RC(16)

RE: Find pds member searching a datset name

(OP)
Hi Nic,
I have a result of a SQL query C1 in Outsql, the query looks for a file VSAM and finds the members of this PDS but when he there are alternating indexes, the query finds multiple members.
(Depending on the file to be searched one or more members finded).
Like that:
Abcdef1
Abcdef2
Abcdef3
Abcdef4
If the Sqlcode = 0
How can I write in rexx the result by saying that : (
MEMB1 = abcdef1
MEMB2 = Abcdef2
MEMB3 = Abcdef3
etc...

For the moment i have this rexx shortcut:
cpt=0
.
select ...
.
c1 : outsql
if sqlclode = 0 then do
say 'name member :'cpt' - ' outsql
end
cpt=cpt+1

in advance thank you.


RE: Find pds member searching a datset name

You need to start a new topic. This query does not refer to the problem that this topic is about. Also, do not address a topic to a specific person.


Nic

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close