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.
//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
?
Please give an example.
Nic
RE: Find pds member searching a datset name
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
Nic
RE: Find pds member searching a datset name
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
CODE -->
CODE
Nic
RE: Find pds member searching a datset name
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
RE: Find pds member searching a datset name
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
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
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
When I look into your script, it seems that your dataset name is in the variable FICS
So I would try following
CODE
RE: Find pds member searching a datset name
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
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
RE: Find pds member searching a datset name
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
Nic
RE: Find pds member searching a datset name
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
What messages are you getting (this was requested last week!)?
Still need the trace.
Nic
RE: Find pds member searching a datset name
RE: Find pds member searching a datset name
RE: Find pds member searching a datset name
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
Nic
RE: Find pds member searching a datset name
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
Example
CODE
Nic
RE: Find pds member searching a datset name
when you paste your code, then paste it between the tags:
...
RE: Find pds member searching a datset name
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
Nic
RE: Find pds member searching a datset name
This is the JCL created when I do a search on my JCL library:
CODE --> JCL
Nic
RE: Find pds member searching a datset name
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
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
Nic