Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Generating and Viewing JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Generating and Viewing JCL
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Jan 23, 2014 4:56 am    Post subject: Reply to: Generating and Viewing a JCL using REXX
Reply with quote

see here

http://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    Post subject: Reply to: Generating and Viewing a JCL using REXX
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

Senior Member


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

PostPosted: Thu Jan 23, 2014 6:07 am    Post subject: Reply to: Generating and Viewing a JCL using REXX
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: 175
Location: UK

PostPosted: Thu Jan 23, 2014 4:23 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Jan 23, 2014 10:09 pm    Post subject: Reply to: Generating and Viewing JCL
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Jan 23, 2014 10:18 pm    Post subject: Reply to: Generating and Viewing JCL
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

Senior Member


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

PostPosted: Fri Jan 24, 2014 9:30 pm    Post subject: Reply to: Generating and Viewing JCL
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    Post subject:
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

Senior Member


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

PostPosted: Mon Jan 27, 2014 10:52 pm    Post subject: Reply to: Generating and Viewing JCL
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Jan 27, 2014 11:31 pm    Post subject: Reply to: Generating and Viewing JCL
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

Senior Member


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

PostPosted: Tue Jan 28, 2014 12:03 am    Post subject: Reply to: Generating and Viewing JCL
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Jan 28, 2014 12:14 am    Post subject: Reply to: Generating and Viewing JCL
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    Post subject: Reply to: Generating and Viewing JCL
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    Post subject:
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

Senior Member


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

PostPosted: Tue Jan 28, 2014 5:38 am    Post subject: Reply to: Generating and Viewing JCL
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Generating an o/p file with dummy i/p... wiprov DFSORT/ICETOOL 2 Wed Sep 10, 2014 6:16 pm
No new posts Generating test Data by Recursive SQL Jimy Carol DB2 2 Thu Dec 26, 2013 3:00 pm
No new posts Generating Sequence Number in SORT wi... Debasis Misra JCL & VSAM 1 Sun Aug 25, 2013 12:26 pm
No new posts Viewing binary record kishpra COBOL Programming 4 Tue Aug 13, 2013 12:35 pm
No new posts Generating report with DFSORT Bharath RajaramSridharan DFSORT/ICETOOL 6 Wed Apr 17, 2013 8:36 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us