Allocating files using IRXJCL & IKJEFT1A



IBM's Command List programming language & Restructured Extended Executor

Allocating files using IRXJCL & IKJEFT1A

Postby MNevarez » Tue Nov 04, 2008 4:04 am

I noticed that when I try to run my rexx program using IRXJCL I'm receiving file allocation errors. Can you tell me what has to change. Also; RPTINPUT, RPTSRTD, SRTCNTL & SRTMEMB are symbolics where I feed my JCL libraries into. It made no sense to hardcode them all over the place.

Output Listing from IRXJCL

   465 *-*  "FREE FI(RPTFILE)"                                                 
       +++ RC(-3) +++                                                           
   466 *-*  "ALLOC FI(RPTFILE) DA('"||RPTINPUT||"') NEW CATALOG",               
       +++ RC(-3) +++                                                           
IRX0555E The input or output file RPTFILE is not allocated. It cannot be opened
IRX0670E EXECIO error while trying to GET or PUT a record.                     
*** RPTFILE HAS BEEN WRITTEN ***                                               
*** SORTING CMN110 REPORT FILE ***                                             
   780 *-*  "FREE FI(SYSOUT SORTIN SORTOUT SYSIN SORTWK01)"                     
       +++ RC(-3) +++                                                           
   781 *-*  "ALLOC FI(SYSOUT)  DA(*)"                                           
       +++ RC(-3) +++                                                           
   782 *-*  "ALLOC FI(SORTIN)  DA('"||RPTINPUT||"') SHR REUSE"                 
       +++ RC(-3) +++                                                           
   783 *-*  "ALLOC FI(SORTOUT) DA('"||RPTSRTD||"') NEW CATALOG",               
       +++ RC(-3) +++                                                           
   785 *-*  "ALLOC FI(SYSIN)   DA('"||SRTCNTL||"("||SRTMEMB||")') SHR REUSE"   
       +++ RC(-3) +++                                                           
   786 *-*  "ALLOCATE FI(SORTWK01) NEW DELETE SPACE(15,10) CYLINDERS "         
       +++ RC(-3) +++                                                           
IRX0251E User abend code 0158, reason code 00000020.                           
IRX0255E Abend in host command ICEMAN or address environment routine LINKMVS.   
   787 *-*  ADDRESS LINKMVS ICEMAN                                             
       +++ RC(158) +++                                                         
*** DONE SORTING CMN110 REPORT FILE ***                                         
   473 *-*  "FREE FI(REPORT)"                                                   
       +++ RC(-3) +++                                                           
   474 *-*  "ALLOC FI(REPORT) DA(*)"                                           
       +++ RC(-3) +++                                                           
*** PROCESSING SORTED REPORT FILE ***                                           
   149 *-*  "ALLOC FI(SRTDFILE) DA('"||RPTSRTD||"') SHR REUSE"                 
       +++ RC(-3) +++                                                           
IRX0555E The input or output file SRTDFILE is not allocated. It cannot be opened
IRX0670E EXECIO error while trying to GET or PUT a record.                     
*** REPORT FILE HAS BEEN PRINTED ***                                           
   163 *-*  "FREE FI(SRTDFILE)"                                                 
       +++ RC(-3) +++                                                           
   164 *-*  "FREE FI(REPORT)"                                                   
       +++ RC(-3) +++                                                           
*** CLEANING UP FILES THAT WERE ALLOCATED ***                                   
   811 *-*   "FREE FI(SYSPRINT DD1 DD2)"                                       
       +++ RC(-3) +++                                                           
   812 *-*   "ALLOC FI(SYSPRINT)  DA(*)"                                       
       +++ RC(-3) +++                                                           
   813 *-*   "ALLOC FI(DD1)       DA('"||RPTINPUT||"') MOD DELETE",             
       +++ RC(-3) +++                                                           
   815 *-*   "ALLOC FI(DD2)       DA('"||RPTSRTD||"') MOD DELETE",             
       +++ RC(-3) +++                                                           
*** FILES HAVE BEEN DELETED ***                                                 


Here's the output when I used IKJEFT1A

READY                                                                           
%CMN110 3 *            P N G03131 20080101 20081008                             
FILE RPTFILE NOT FREED, IS NOT ALLOCATED                                       
*** RPTFILE HAS BEEN WRITTEN ***                                               
*** SORTING CMN110 REPORT FILE ***                                             
FILE SYSOUT NOT FREED, IS NOT ALLOCATED                                         
FILE SORTIN NOT FREED, IS NOT ALLOCATED                                         
FILE SORTOUT NOT FREED, IS NOT ALLOCATED                                       
FILE SYSIN NOT FREED, IS NOT ALLOCATED                                         
FILE SORTWK01 NOT FREED, IS NOT ALLOCATED                                       
*** DONE SORTING CMN110 REPORT FILE ***                                         
*** PROCESSING SORTED REPORT FILE ***                                           
*** REPORT FILE HAS BEEN PRINTED ***                                           
*** CLEANING UP FILES THAT WERE ALLOCATED ***                                   
FILE DD1 NOT FREED, IS NOT ALLOCATED                                           
FILE DD2 NOT FREED, IS NOT ALLOCATED                                           
*** FILES HAVE BEEN DELETED ***                                                 
READY                                                                           
END                                                                             


As you can see it worked.

Below you'll find pieces of my code:

/* set File Variables - Change Here */   
                                         
RPTINPUT = 'G03131.CHGMAN.CMN110.FILE'   
RPTSRTD  = 'G03131.CHGMAN.CMN110.SORTED'
SRTCNTL  = 'G03131.CHGMAN.CTC'           
SRTMEMB  = 'SRT110F'                     

"ALLOC FI(SRTDFILE) DA('"||RPTSRTD||"') SHR REUSE"                           

"FREE FI(SYSOUT SORTIN SORTOUT SYSIN SORTWK01)"                                 
"ALLOC FI(SYSOUT)  DA(*)"                                                       
"ALLOC FI(SORTIN)  DA('"||RPTINPUT||"') SHR REUSE"                             
"ALLOC FI(SORTOUT) DA('"||RPTSRTD||"') NEW CATALOG",                           
" REUSE SPACE(1 2) CYLINDERS RECFM(F B) LRECL(133)"                             
"ALLOC FI(SYSIN)   DA('"||SRTCNTL||"("||SRTMEMB||")') SHR REUSE"               
"ALLOCATE FI(SORTWK01) NEW DELETE SPACE(15,10) CYLINDERS "                     
ADDRESS LINKMVS ICEMAN                                                         

"FREE FI(SYSPRINT DD1 DD2)"                                                     
"ALLOC FI(SYSPRINT)  DA(*)"                                                     
"ALLOC FI(DD1)       DA('"||RPTINPUT||"') MOD DELETE",                         
" DELETE SPACE(0) TRACKS UNIT(SYSALLDA)"                                       
"ALLOC FI(DD2)       DA('"||RPTSRTD||"') MOD DELETE",                           
" DELETE SPACE(0) TRACKS UNIT(SYSALLDA)"                                       
ADDRESS LINKMVS IEFBR14                                                         


Any assistance would be greatly appreciated.
MNevarez
 
Posts: 8
Joined: Tue Sep 25, 2007 10:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Allocating files using IRXJCL & IKJEFT1A

Postby MrSpock » Tue Nov 04, 2008 5:31 am

The IRXJCL program is the REXX interpreter. It allows you to execute REXX code in a batch or non-TSO address space.

The IKJEFT01/IKJEFT1A/IKJEFT1B programs are known as the Terminal Monitor Program (TMP), better known to you and I as TSO/E. When you execute the TMP program you're initiating a TSO/E address space in batch. Any REXX or CLIST code you run here will run the same way as it would in a foreground TSO/E address space.

ALLOCATE and FREE are TSO/E commands, not REXX instructions. They don't work outside of a TSO/E address space.

For programs that need to allocate datasets outside of the TSO/E environment, IBM supplies the BPXWDYN Text Interface to Dynamic Allocation and Dynamic Output program.

Normally, when you run a REXX exec in batch, all of your dataset allocations are handled in the JCL, so it usually won't matter if you use IRXJCL or IKJEFT**. If you have no preference one way or the other, than it just makes sense to always use one of the IKJEFT** programs as a matter of habit.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Allocating files using IRXJCL & IKJEFT1A

Postby MrSpock » Tue Nov 04, 2008 5:37 am

Also, on a seperate note, it's not normally recommended to code SORTWK DD statements for most processing. You're better off letting your sort product allocate whatever additional storage it may need dynamically.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Allocating files using IRXJCL & IKJEFT1A

Postby MNevarez » Wed Nov 05, 2008 4:02 am

Mr Spock,

Thank you for getting back to me. The original Rexx program was using IRXJCL. But, since I had a requirement to sort I decided to go the route I took. I thought about having multiple steps in the job but wanted to see if I can keep it in one program. I had some variables that had to be passed and didn't want to duplicate what I was trying to accomplish.

Thanks again for your help.
MNevarez
 
Posts: 8
Joined: Tue Sep 25, 2007 10:46 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post