View previous topic :: View next topic
Author
Message
Bharath RajaramSridharan New User Joined: 10 Dec 2012Posts: 20 Location: Australia
Hi,
I wanted to copy the contents of the file into a table. But each of my ispexec commands returns an RC of -3.Here is my piece of code. Could someone help me to correct the issue.
Code:
/* REXX */
call read_files
call process_file
/* FREE FILE DATASET DEFINITIONS*/
address tso "free fi(opcfil)"
exit
/*******************************************************************/
read_files:
/* INPUT FILE ALLOCATION */
address tso "execio * diskr opcfil (stem opcstem. finis"
return 0
/*******************************************************************/
process_file:
/* READ INPUT FILE */
trace i
address ispexec "libdef isptabl dataset id(USERID.TABLE')"
address ispexec "tbcreate opctabl names (actjb prdjb) write"
do i = 1 to opcstem.0
actjb = substr(opcstem.i,1,34)
prdjb = substr(opcstem.i,40,34)
address ispexec "tbadd opctabl order"
end
address ispexec "tbclose opctabl"
exit
return 0
Back to top
PeterHolland Global Moderator Joined: 27 Oct 2009Posts: 2481 Location: Netherlands, Amstelveen
I see an unbalanced single quote.
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8797 Location: Welsh Wales
Where do you allocate the input file ?
Or is this a batch process
If so have you allocated all of the required ISPF libraries in the JCL
As a precaution I usually do a TBCLOSE / TBEREASE before creating a new table
Why do you not use REPLACE when creating the table
No other clues given in the output
Back to top
Bharath RajaramSridharan New User Joined: 10 Dec 2012Posts: 20 Location: Australia
Hi Peter,
The quote was an mistake while I pasted the code here.
Hi Expat,
I run the EXEC through a batch jcl. This is my jcl. Do you see if I have missed any of the libraries being allocated. Please let me know.
Code:
//OPCSCHDR EXEC PGM=IKJEFT01,PARM='OPCTBDMP'
//SYSPROC DD DSN=USERID.EXEC,DISP=SHR
//ISPTABL DD DSN=USERID.TABLE,DISP=SHR
//ISPPLIB DD DSN=SYS1.SISPPENU,DISP=SHR
//ISPMLIB DD DSN=SYS1.SISPMENU,DISP=SHR
//ISPSLIB DD DSN=SYS1.SISPSENU,DISP=SHR
// DD DSN=SYS1.SISPSLIB,DISP=SHR
//ISPTLIB DD DSN=SYS1.SISPTENU,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//ISPPROF DD DSN=,DISP=(NEW,DELETE),UNIT=,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3120,DSORG=PO),
// SPACE=(3120,(20,5,10))
//ISPCTL0 DD UNIT=,DISP=(NEW,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,BUFNO=4,DSORG=PS),
// SPACE=(TRK,(10,5))
//ISPCTL1 DD UNIT=,DISP=(NEW,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,BUFNO=4,DSORG=PS),
// SPACE=(TRK,(10,5))
//ISPCTL2 DD UNIT=,DISP=(NEW,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,BUFNO=4,DSORG=PS),
// SPACE=(TRK,(10,5))
//ISPWRK0 DD UNIT=,DISP=(NEW,DELETE),
// DCB=(RECFM=FB,LRECL=256,BLKSIZE=2560,BUFNO=4,DSORG=PS),
// SPACE=(CYL,(5,5))
//ISPWRK1 DD UNIT=,DISP=(NEW,DELETE),
// DCB=(RECFM=FB,LRECL=256,BLKSIZE=2560,BUFNO=4,DSORG=PS),
// SPACE=(CYL,(5,5))
//ISPWRK2 DD UNIT=,DISP=(NEW,DELETE),
// DCB=(RECFM=FB,LRECL=256,BLKSIZE=2560,BUFNO=4,DSORG=PS),
// SPACE=(CYL,(5,5))
//ISPFILE DD DUMMY
//ISPLOG DD SYSOUT=*,DCB=(RECFM=VA,LRECL=125,BLKSIZE=129)
//OPCFIL DD DSN=USERID.OPCFIL.INPUT,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
This is the trace of the return code -3
Code:
29 *-* address ispexec "tbcreate opctabl names (actjb prdjb) write"
>L> "tbcreate opctabl names (actjb prdjb) write"
+++ RC(-3) +++
Back to top
PeterHolland Global Moderator Joined: 27 Oct 2009Posts: 2481 Location: Netherlands, Amstelveen
address ispexec "tbadd opctabl order"
You didnt issue a required TBSORT for the table.
Back to top
Bharath RajaramSridharan New User Joined: 10 Dec 2012Posts: 20 Location: Australia
Peter,
But the exec is returning a -3 code well above it in the libdef ispexec statement itself. In fact, all the ispexec statements return a -3 code. I checked the manuals but couldn't find the reason for it.
Back to top
PeterHolland Global Moderator Joined: 27 Oct 2009Posts: 2481 Location: Netherlands, Amstelveen
So supply us the whole trace output and eventually also JES output of your job.
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
pretty elementary ...
instead of
Code:
//OPCSCHDR EXEC PGM=IKJEFT01,PARM='OPCTBDMP'
You should have used
Code:
//OPCSCHDR EXEC PGM=IKJEFT01,PARM='ISPSTART CMD(OPCTBDMP)'
Back to top
Bharath RajaramSridharan New User Joined: 10 Dec 2012Posts: 20 Location: Australia
Thanks Enrico. I wasn't aware of that as it my first exercise writing exec involving tables.
Back to top
PeterHolland Global Moderator Joined: 27 Oct 2009Posts: 2481 Location: Netherlands, Amstelveen
Of course Enrico, one sometimes forgets all about the basics. Nice.
Back to top
Please enable JavaScript!