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
 

 

File Tailoring using REXX executed in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
venksiv

New User


Joined: 20 Jun 2015
Posts: 26
Location: INDIA

PostPosted: Fri Aug 28, 2015 3:25 pm    Post subject: File Tailoring using REXX executed in JCL
Reply with quote

Hi all,

I referred this post and tried to resolve the error I am getting while executing File Tailoring functionality using REXX in JCL. Couldn't pin point where the issue is: whether it is in JCL or REXX code.

http://ibmmainframes.com/archive/o_t__t_20204__start_15__index.html

One vital point is: the job executes fine when executed under my logon but fails while executing via Scheduler. Please guide me how to fix this issue.

Error:
Code:
.SARPAGE 7                                                             
.ACF0C038 ACF2 LOGONID ATTRIBUTES HAVE REPLACED DEFAULT USER ATTRIBUTES
.READY                                                                 
.PROFILE NOPREFIX                                                     
.READY                                                                 
.ISPSTART CMD(%HRD)                                                   
.FILE ISPFILE NOT FREED, IS NOT ALLOCATED                             
.ISPF system data set allocation error - press Enter to continue.     
.Temporary control card data set cannot be allocated.                 
.DAIR RC = 12 dec, DARC = 970C hex.                                   
.  ISPF102 No work file            -/-Work file not open.             


JCL:
Code:
//STEP05R  EXEC PGM=IKJEFT1A,DYNAMNBR=200
//SYSEXEC  DD DISP=SHR,DSN=&PART1..EXEC   
//ISPPLIB  DD DSN=SYS1.SISPPENU,DISP=SHR 
//ISPTLIB  DD DSN=SYS1.SISPTENU,DISP=SHR 
//ISPSLIB  DD DSN=SYS1.SISPSLIB,DISP=SHR 
//         DD DSN=SYS1.SISPSENU,DISP=SHR 
//         DD DSN=&PART1..JCLSKEL,DISP=SHR
//ISPMLIB  DD DSN=SYS1.SEZAMENU,DISP=SHR 
//         DD DSN=SYS1.SBPXMENU,DISP=SHR 
//         DD DSN=SYS1.SISPMENU,DISP=SHR 
//ISPLLIB  DD DSN=SYS1.MIGLIB,DISP=SHR   
//         DD DSN=SYS2.ML.MERLLIB,DISP=SHR
//SYSEDIT  DD SPACE=(CYL,(1,5)),UNIT=SYSDA
//SYSEDIT2 DD SPACE=(CYL,(1,5)),UNIT=SYSDA
//SYSUT1   DD SPACE=(CYL,(1,1)),UNIT=SYSDA
//SYSUT2   DD SPACE=(CYL,(1,1)),UNIT=SYSDA
//SYSUT3   DD SPACE=(CYL,(1,1)),UNIT=SYSDA
//SYSUT4   DD SPACE=(CYL,(1,1)),UNIT=SYSDA
//SYSOUT   DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                               
//SYSTSPRT DD SYSOUT=*                               
//SYSUDUMP DD SYSOUT=*                               
//ISPCTL0 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1),RLSE),
// LRECL=80,BLKSIZE=0,RECFM=FB                       
//ISPCTL1 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1),RLSE),
// LRECL=80,BLKSIZE=0,RECFM=FB                       
//ISPPROF  DD UNIT=SYSDA,                             
//  DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=0),       
//  SPACE=(CYL,(5,0,5))                               
//ISPLOG   DD UNIT=SYSDA,                             
//  DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=0),       
//  SPACE=(CYL,(5,0))                                 
//SYSTSIN  DD *                                       
PROFILE NOPREFIX                                     
ISPSTART CMD(%HRD)                                   
/*                                                   


REXX:
Code:
JCLPDS     = 'TRWTRTS.HRDTOOL.SUBMIT.JCL.#'||REQNUM
CHK = SYSDSN("'"JCLPDS"'")                                     
IF CHK = OK THEN                                               
   DO                                                         
      /* DELETE IF THE FILE NAME IS ALREADY ALLOCATED */       
      ADDRESS TSO "FREE FI(ISPFILE)"                           
      ADDRESS TSO "DELETE '"JCLPDS"'"                         
   END                                                         
ADDRESS TSO "FREE FI(ISPFILE)"                                 
"ALLOC DA('"JCLPDS"') DD(ISPFILE) DSORG(PO) TRACKS SPACE(10,10)
LRECL(80) BLKSIZE(8000) DIR(5) RECFM(F,B) NEW"                 
ADDRESS ISPEXEC                                             
"ISPEXEC LIBDEF ISPSLIB DATASET ID('"SKELPDS"')"           
"ISPEXEC LIBDEF ISPFILE DATASET ID('"JCLPDS"')"             
                                                           
/* EMAIL TEXT SKELETON */                                   
IF  ERROR_FLAG = 'N' THEN                                   
    DO                                                     
      "FTOPEN"                                             
      "FTINCL EMAIL1"                          /* SUCCESS */
      "FTCLOSE NAME(EMAIL1) LIBRARY(ISPFILE)"               
      ADDRESS TSO "DELETE '"REQFILE"'"                     
    END                                                     
/* JCL SKELETON */                       
ADDRESS ISPEXEC                         
"FTOPEN"                                 
"FTINCL RTSHRDQ2"                       
"FTCLOSE NAME(RTSHRDQ2) LIBRARY(ISPFILE)"
                                         
SUBJCL = JCLPDS||'('||RTSHRDQ2||')'     
                                         
ADDRESS TSO                             
M = OUTTRAP('MSG.')                     
"SUBMIT '"SUBJCL"'"                     
M = OUTTRAP('OFF')                       
"FREE FI(ISPFILE)"                       
Back to top
View user's profile Send private message

venksiv

New User


Joined: 20 Jun 2015
Posts: 26
Location: INDIA

PostPosted: Fri Aug 28, 2015 4:14 pm    Post subject: problem fixed!
Reply with quote

I fixed the issue by just changing the Control Library DD name.

FROM
Code:

//ISPCTL0 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1),RLSE),
// LRECL=80,BLKSIZE=0,RECFM=FB                       
//ISPCTL1 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1),RLSE),
// LRECL=80,BLKSIZE=0,RECFM=FB                       


TO
Code:

//ISPCT0 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1),RLSE),
// LRECL=80,BLKSIZE=0,RECFM=FB                       
//ISPCT1 DD DISP=NEW,UNIT=VIO,SPACE=(CYL,(1,1),RLSE),
// LRECL=80,BLKSIZE=0,RECFM=FB                       


And, also by including Work File:
Code:

//ISPWRK1   DD  DISP=(,DELETE),                       
//          UNIT=SYSDA,                               
//          SPACE=(TRK,(5,5,10)),                     
//          DCB=(DSORG=PO,RECFM=FB,LRECL=256,BLKSIZE=0)
//ISPWRK2   DD  DISP=(,DELETE),                       
//          UNIT=SYSDA,                               
//          SPACE=(TRK,(5,5,10)),                     
//          DCB=(DSORG=PO,RECFM=FB,LRECL=256,BLKSIZE=0)
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1717
Location: UK

PostPosted: Fri Aug 28, 2015 4:15 pm    Post subject:
Reply with quote

What did running it with a trace tell you?
Back to top
View user's profile Send private message
venksiv

New User


Joined: 20 Jun 2015
Posts: 26
Location: INDIA

PostPosted: Fri Aug 28, 2015 5:55 pm    Post subject:
Reply with quote

Hi Nic,

I did not do a TRACE before fixing the issue. However, I now recreated the issue with the incorrect JCL I used before. Here is the "TRACE I" result:

Code:
.SARPAGE 15                                                     
.   230 *-*  /* EMAIL TEXT SKELETON */                           
.   231 *-*  IF  ERROR_FLAG = 'N'                               
.       >V>    "Y"                                               
.       >L>    "N"                                               
.       >O>    "0"                                               
.   238 *-*  ELSE                                               
.   239 *-*   DO                                                 
.   240 *-*    /* FAILURE EMAIL TO REQUESTOR */                 
.   241 *-*    "FTOPEN"                                         
.       >L>      "FTOPEN"                                       
.ISPF system data set allocation error - press Enter to continue.
.Temporary control card data set cannot be allocated.           
.DAIR RC = 12 dec, DARC = 970C hex.                             
.  ISPF102 No work file            -/-Work file not open.       
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1717
Location: UK

PostPosted: Fri Aug 28, 2015 7:25 pm    Post subject:
Reply with quote

Ah right. You posted your fix whilst I was posting my query.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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