IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Generating and Viewing JCL


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinaysetlur

New User


Joined: 04 Jan 2008
Posts: 13
Location: United States

PostPosted: Thu Jan 23, 2014 4:45 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Jan 23, 2014 4:56 am
Reply with quote

see here

www.ibmmainframes.com/viewtopic.php?t=55549&highlight=ftincl
Back to top
View user's profile Send private message
vinaysetlur

New User


Joined: 04 Jan 2008
Posts: 13
Location: United States

PostPosted: Thu Jan 23, 2014 5:06 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Thu Jan 23, 2014 6:07 am
Reply with quote

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
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Thu Jan 23, 2014 4:23 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Thu Jan 23, 2014 10:09 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Jan 23, 2014 10:18 pm
Reply with 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

also the message as posted looks quite strange

I would investigate somewhere else!
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Fri Jan 24, 2014 9:30 pm
Reply with quote

Show us the code that results in a 'data set not found' message.
Back to top
View user's profile Send private message
vinaysetlur

New User


Joined: 04 Jan 2008
Posts: 13
Location: United States

PostPosted: Sat Jan 25, 2014 10:10 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Mon Jan 27, 2014 10:52 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Jan 27, 2014 11:31 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Tue Jan 28, 2014 12:03 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Jan 28, 2014 12:14 am
Reply with quote

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
View user's profile Send private message
vinaysetlur

New User


Joined: 04 Jan 2008
Posts: 13
Location: United States

PostPosted: Tue Jan 28, 2014 2:35 am
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Tue Jan 28, 2014 3:30 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Tue Jan 28, 2014 5:38 am
Reply with quote

Quote:
Do I code FREE F(ZTEMPF) ?

Free the DD name, not the data set name:
Code:
FREE F(ISPCTL1)

And free it before you start ISPF.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Viewing MQ paameters!! Java & MQSeries 1
No new posts Viewing executing process in NDM .. q... IBM Tools 0
No new posts Generating an o/p file with dummy i/p... DFSORT/ICETOOL 2
No new posts Generating test Data by Recursive SQL DB2 2
No new posts Generating Sequence Number in SORT wi... JCL & VSAM 1
Search our Forums:

Back to Top