FUNCTION TERMINATED. CONDITION CODE IS 12



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

FUNCTION TERMINATED. CONDITION CODE IS 12

Postby dn2012 » Fri Feb 17, 2012 2:39 am

Hello,

I ma importing transaction thru following JCL but getting


REPRO INFILE(INPUT) OUTFILE(OUTPUT)
IDC3302I ACTION ERROR ON IMSTESTA.IMFTABLE.NEW
IDC3314I **RECORD OUT OF SEQUENCE - KEY FOLLOWS:
000000 D4C3E3D7 C1C4C6E3 C3F0F0F4 F8F9F640 40404040 40404040

**** Repeating few times and than I go message as below:


IDC31467I MAXIMUM ERROR LIMIT REACHED.
IDC0005I NUMBER OF RECORDS PROCESSED WAS 104282
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12

Here is the JCL
*************************
*****************************************************************************************************
//* DELETE/DEFINE IMFTABLE VSAM FILE
//*----------------------------------------------------------------------------------------------------------------
//*
//IMF1 EXEC PGM=IDCAMS
//DD1 DD DISP=OLD,DSN=IMSTESTA.IMFTABLE.NEW
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (IMSTESTA.IMFTABLE.NEW) CLUSTER PURGE
DEFINE CLUSTER( -
NAME(IMSTESTA.IMFTABLE.NEW) -
FREESPACE(0 0) -
INDEXED -
KEYS(24 0) -
RECORDSIZE(80 80) -
SHAREOPTIONS(3 3) -
ERASE -
UNIQUE -
STORCLAS(NULL) -
VOLUMES(IMSA01) -
CYLINDERS(40 10) -
) -
DATA( -
NAME(TESTA.IMFTABLE.NEW.DATA) -
CONTROLINTERVALSIZE(8192) -
) -
INDEX( -
NAME(TESTA.IMFTABLE.NEW.INDEX) -
CONTROLINTERVALSIZE(8192))
/*
//*
//*-----------------------------------------------------------------*
//* DO LISTCAT OF IMFTABLE VSAM FILE *
//*-----------------------------------------------------------------*
//*
//LISTCAT EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES(TESTA.IMFTABLE.NEW) ALL
//*
//*-----------------------------------------------------------------*
//* SORT DATA BEFORE REPRO INTO VSAM FILE *
//*-----------------------------------------------------------------*
//*
//SORT EXEC PGM=SORT
//SORTIN DD DISP=OLD,DSN=TESTA.IMF310.ITD.SOURCE(DEFAULT)
// DD DISP=OLD,DSN=TESTA.IMF310.ITD.SOURCE(CWS)
// DD DISP=OLD,DSN=TESTA.IMF310.ITD.SOURCE(TCIS0216)
// DD DISP=OLD,DSN=TESTA.IMF310.ITD.SOURCE(PDB) ## 10/28/11
// DD DISP=OLD,DSN=TESTA.IMF310.ITD.SOURCE(ETRS1211)
//SORTOUT DD DISP=OLD,DSN=TESTA.IMF310.ITD.SOURCE.DATA
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(10,10))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(10,10))
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(10,10))
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,(10,10))
//SORTWK05 DD UNIT=SYSDA,SPACE=(CYL,(10,10))
//SORTWK06 DD UNIT=SYSDA,SPACE=(CYL,(10,10))
//* SORT FIELDS=(1,32,CH,A)
//SYSIN DD *
//* SORT FIELDS=(1,32,CH,A)
SORT FIELDS=COPY
SUM FIELDS=NONE
/*
//*-----------------------------------------------------------------*
//* PRINT SORTED DATA (FOR VALIDATION) *
//*-----------------------------------------------------------------*
//*
//*PRINT EXEC PGM=IEBGENER
//*SYSUT1 DD DISP=OLD,DSN=TESTA.IMF310.ITD.SOURCE.DATA
//*SYSUT2 DD SYSOUT=*,DCB=(RECFM=FB,LRECL=80,BLKSIZE=6400)
//*SYSPRINT DD SYSOUT=*
//*SYSIN DD DUMMY
//*
//*
//*-----------------------------------------------------------------*
//* BUILD IMFTABLE VSAM FILE *
//*-----------------------------------------------------------------*
//*
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//PRINTO DD SYSOUT=*
//INPUT DD DISP=OLD,DSN=TESTA.IMF310.ITD.SOURCE.DATA
//OUTPUT DD DISP=OLD,DSN=TESTA.IMFTABLE.NEW
//SYSIN DD *
REPRO INFILE(INPUT) OUTFILE(OUTPUT)
END
/*
//*-------------------------------------------------------*
//* TELL OPERATIONS THAT THIS JOB FAILED DUE TO ABEND *
//*-------------------------------------------------------*
//ABEND1 EXEC PGM=ITDWTOR,COND=ONLY
//STEPLIB DD DSN=IMSB.PGMLIB,DISP=SHR
//SYSUDUMP DD SYSOUT=*
//SYSIN DD DSN=TESTA.CNTRL(IMFTBLE),DISP=SHR
//*
REPRO INDATASET(TESTA.IMF310.ITD.SOURCE(IMFTABLE)) -
OUTDATASET(TESTA.IMFTABLE.NEW)
END
//
******************************** Bottom of Data ********************************

Thanks
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: FUNCTION TERMINATED. CONDITION CODE IS 12

 

Re: FUNCTION TERMINATED. CONDITION CODE IS 12

Postby Frank Yaeger » Fri Feb 17, 2012 2:50 am

The error message indicates to me that your VSAM records are not in order by the defined key:

  SORT FIELDS=COPY
  SUM FIELDS=NONE


This does a COPY, not a SORT, so the records are NOT sorted and SUM FIELDS=NONE is ignored.

If you want to sort the records and remove duplicates, you need to use an appropriate SORT statement that corresponds to the key of your VSAM input file. Something like:

//SYSIN DD *
  SORT FIELDS=(1,24,BI,A)
  SUM FIELDS=NONE
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: FUNCTION TERMINATED. CONDITION CODE IS 12

Postby BillyBoyo » Fri Feb 17, 2012 3:26 am

You also have some spare IDCAMS control cards at the end of the JCL. If you don't need them, I'd suggest you delete them to avoid confusion. If you do need them, you need an EXEC card and some other bits and pieces. If you look at your step messages you'll see that the system generated a //SYSIN DD * for you. It worth keeping an eye open for these, as they often indicate something in your Job deck which you might think is JCL or control cards but is actually some "orphaned" cards.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: FUNCTION TERMINATED. CONDITION CODE IS 12

Postby dn2012 » Fri Feb 17, 2012 3:45 am

I removed copy and its showing not error.
But they are some duplicate records in the file per my co worker.

How to check duplicate records?
How to remove duplicate records? thanks
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: FUNCTION TERMINATED. CONDITION CODE IS 12

Postby dn2012 » Fri Feb 17, 2012 3:47 am

what does SUM FIELDS=NONE done?
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: FUNCTION TERMINATED. CONDITION CODE IS 12

Postby Frank Yaeger » Fri Feb 17, 2012 4:58 am

How to remove duplicate records?


As I said previously, you can delete duplicate records with:

//SYSIN DD *
  SORT FIELDS=(1,24,BI,A)
  SUM FIELDS=NONE


Did you use SUM FIELDS=NONE? It will delete duplicate records for the key you specify (1,24,BI in the example above). If it didn't delete duplicate records, then you have the wrong key in the SORT statement.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: FUNCTION TERMINATED. CONDITION CODE IS 12

Postby dn2012 » Fri Feb 17, 2012 5:07 am

thanks
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post