View previous topic :: View next topic
|
Author |
Message |
vinaysetlur
New User
Joined: 04 Jan 2008 Posts: 13 Location: United States
|
|
|
|
Hi , I thought of sharing the following problem I ran into.
Looking up the net and various forum like this.
We know of the standard snippet to submit / run JCL
CODE
************************
address ispexec "ftopen temp"
address ispexec "ftincl IEFBR"
address ispexec "ftclose"
address ispexec "vget ztempf"
address tso
"SUB ' "ZTEMPF" ' "
But I couldn't find a good example that prompts the generated JCL to the user and leaves it to him to submit
That's when I understood that ISPFILE allocation necessary to store the output from file tailoring services. Not only that , the FTCLOSE needs a change as follows: -
FTCLOSE NAME(mbrname) option will write the generated JCL into that member mbrname in the ISPFILE library allocated.
Snippet is as follows: -
CODE
************************
address ispexec "ftopen"
address ispexec "ftincl IEFBR"
address ispexec "ftclose name(MBR)"
address ispexec
"EDIT DATASET('MYUSERID.ISPFILE.LIB(MBRNAME)') " |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
Back to top |
|
|
vinaysetlur
New User
Joined: 04 Jan 2008 Posts: 13 Location: United States
|
|
|
|
Hi Enrico,
Honored to see your response. I have been following all your posts carefully and did a thorough check at my end before posting.
I did read through that post of yours initially.
I tried with the
address ispexec
"VIEW DATASET('"ZTEMPF" ' "
But it gave me an allocation error as follows: -
ERROR
******************************************************************************
*,ISRD028 ,*
*,, , ,*
*,Data set not cataloged , ,*
*,'SYS14022.T165044.RA000.E8751AJ.R0352844' was not found in catalog. ,*
*, ,*
*, ,*
*, ,*
*, ,*
*, ,*
*, ,*
*,Current dialog statement: ,*
*,VIEW dataset('SYS14022.T165044.RA000.E8751AJ.R0352844') ,*
*, ,*
*,Enter,HELP,command for further information regarding this error., ,,*
*,Press,ENTER,key to terminate the dialog., ,,*
*,, , ,*
*, , , ,, ,,*
That was when I was forced to use ISPFILE to store the output.
Since I am new to REXX , could you guide me how this error could have been avoided ? Does the TEMP need to be pre-allocated ?
Any related links on this will also help. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
When you specify a data set name, the system looks for where it is by looking in the catalog. Unfortunately, temporary data sets are not cataloged. It would be nice if it scanned your existing allocations, but it does not (actually, I am not sure that it -would- be nice)
Along with ZTEMPF, there is a companion variable ZTEMPN, which has the DDname of the temporary file.
Try something like this:
Code: |
If (SysVar('SysEnv') = "FORE" & parm = 'VIEW') Then
Do
/* --- look at the File Tailoring output --- */
"LMINIT DATAID(DATAID) DDNAME("ztempn")"
"VIEW DATAID(&DATAID)"
"LMFREE DATAID(&DATAID)"
End |
|
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
Can't you just do a vget to find out the temporary dataset name? I have always found this to work -
Code: |
'vget 'ztempf''
"edit dataset ('"ztempf"')"
|
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Quote: |
Can't you just do a vget to find out the temporary dataset name? |
You must have missed this, which shows that he already has the name:
Code: |
*,ISRD028 ,*
*,, , ,*
*,Data set not cataloged , ,*
*,'SYS14022.T165044.RA000.E8751AJ.R0352844' was not found in catalog. ,* |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
the approach
VGET ZTEMPF
do anything You want after that, has worked for ages
if the TS can submit the ZTEMPF thing I do not really see any reason
for not being able to BROWSE/VIEW/EDIT it
also the message as posted looks quite strange
I would investigate somewhere else! |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Show us the code that results in a 'data set not found' message. |
|
Back to top |
|
|
vinaysetlur
New User
Joined: 04 Jan 2008 Posts: 13 Location: United States
|
|
|
|
Here's the code: -
(I don't have a Mainframe display editor from where I can copy-paste).
I had to $INDFILE to a text file and attached pasted from there.
Code: |
/* rexx */
main_para:
user = userid()
say 'Pass Dataset Name'
pull ds1
x = sysdsn("'"ds1"'")
address ispexec
"libdef ispslib dataset id('E8751AJ.IMS.ISPSLIB')"
select
when x = 'OK' then call dispshr
when x = 'DATASET NOT FOUND' then call createds
otherwise
say 'RC=Problem with sysdsn' rc
end
exit
dispshr:
parm = 'DISP=SHR'
address ispexec "ftopen temp"
address ispexec "ftincl IEFBR"
address ispexec "ftclose"
address ispexec "vget ztempf"
address ISPEXEC
"view DATASET('"ztempf"')"
TRACE I
return
createds:
parm = 'DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)'
address ispexec "ftopen temp"
address ispexec "ftincl IEFBR"
address ispexec "ftclose"
address ispexec "vget ztempf"
address ispexec
"view DATASET('"ztempf"')"
TRACE I
return |
Attachment removed and content inlined and Code'd.
Suggest doing this initially in the future |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Quote: |
the approach
VGET ZTEMPF
do anything You want after that, has worked for ages
if the TS can submit the ZTEMPF thing I do not really see any reason
for not being able to BROWSE/VIEW/EDIT it |
I also get the same results: I can SUBMIT, but I cannot view. I suspect that SUBMIT has special code to look at your current allocations; code that VIEW does not have. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
I just tested for the umpteenth time
and running the snippet I posted with trace "R"
shows for the view command
"VIEW DATASET('ENRICO.SPFTEMP1.CNTL')"
and it works
FIX YOUR LOGON PROCEDURE |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
I think the difference is the dynamically allocated file:
Code: |
//ISPCTL1 DD UNIT=SYSVIO,SPACE=(CYL,(1,1)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800) |
versus an explicitly allocated data set.
I suppose you can say the logon proc is broken... but I cannot edit. I suppose FREE and ALLOCATE after logon is an option.
Does each person at your site have their own logon proc? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
I do not have any ISPCTLxx files in my logon proc
and since ISPF allocates them dynamically they are allocated with a proper name
the only instance where I have the ISPCTLxx datasets allocated thru JCL
is when I run ISPF batch
to avoid conflicts with the ISPCTLxx datasets allocated by the TSO session
Quote: |
I suppose FREE and ALLOCATE after logon is an option.
|
if You can free them before starting ISPF then You should be OK |
|
Back to top |
|
|
vinaysetlur
New User
Joined: 04 Jan 2008 Posts: 13 Location: United States
|
|
|
|
Enrico ,
So you are having no issues while 'viewing' the temp dataset ?
The REXX I'm executing is done fore-ground not via batch.
I guess it may have something to do with my Logon procedure, as you and Pedro highlighted.
What do I code there ? This what I have currently have:-
Do I code FREE F(ZTEMPF) ?
CONTROL NOFLUSH
ALLOC FI(MYCLIB) SHR REUSE DA('E8751AJ.A.CLIST' +
'K9299TD1.DB2DBU.CLIST')
CONCAT SYSPROC MYCLIB
ALLOC FI(MYREXX) SHR REUSE DA('E8751AJ.A.CLIST' +
'K9299TD1.DB2DBU.CLIST')
CONCAT SYSEXEC MYREXX
ALLOC FI(MYPLIB) SHR REUSE DA('E8741AA.ISPPLIB')
CONCAT ISPPLIB MYPLIB
ALLOC FI(MYMLIB) SHR REUSE DA('E8741AA.ISPMLIB' +
'SYSCMN.DEV.MESSAGES.MDBA')
CONCAT ISPMLIB MYMLIB
%BOOKMAN
%PROJCL
%XEDCMDS
%DB2WHO
%FAIMS |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
I also had no issue executing you rexx, as stated by Enrico, I also do not
have any ISPCTLxx files in my logon proc. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Quote: |
Do I code FREE F(ZTEMPF) ? |
Free the DD name, not the data set name:
And free it before you start ISPF. |
|
Back to top |
|
|
|