Page 1 of 1

Current Timestamp in LOAD JCL

PostPosted: Tue Sep 04, 2012 3:59 pm
by DANIPSX
Hi,

I'm using this JCL to load a table using a file, but I need to set one of the table fields to CURRENT_TIMESTAMP.

How can I do it?. Thanks.


//MGJ16417 JOB BD,'MINIBK',MSGCLASS=X,CLASS=D,
// REGION=0M,NOTIFY=TSDEGMD,
// RESTART=*
/*JOBPARM S=SYSB
//*********************************************
//**LOAD DE LA TABLA D1BPEPA.T6001AE **
//*********************************************
//T6001AE EXEC DSNUPROC,SYSTEM=DBD1,UID='T2131FL',UTPROC='',TIME=500
//STEPLIB DD DISP=SHR,DSN=DB2910.DESA.SDSNLOAD
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(450,45),RLSE)
//SORTOUT DD UNIT=SYSDA,SPACE=(CYL,(450,45),RLSE)
//SYSERR DD UNIT=SYSDA,SPACE=(CYL,(450,45),,,ROUND)
//SYSMAP DD UNIT=SYSDA,SPACE=(CYL,(450,45),,,ROUND)
//SYSREC DD DISP=SHR,DSN=TSDX.OF1641.MGJ16416.MGP16415.SALIDA
//SORTWK01 DD SPACE=(CYL,(500,50),RLSE)
//SORTWK02 DD SPACE=(CYL,(500,50),RLSE)
//SORTWK03 DD SPACE=(CYL,(500,50),RLSE)
//SORTWK04 DD SPACE=(CYL,(500,50),RLSE)
//SORTWK05 DD SPACE=(CYL,(500,50),RLSE)
//SORTWK06 DD SPACE=(CYL,(500,50),RLSE)
//UTPRINT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LOAD DATA INDDN SYSREC REPLACE LOG NO NOCOPYPEND
INTO TABLE D1BPEPA.T6001AE

Re: Current Timestamp in LOAD JCL

PostPosted: Tue Sep 04, 2012 4:27 pm
by NicC
Nothing to do with JCL - all to do with DB2 - moved.

Re: Current Timestamp in LOAD JCL

PostPosted: Tue Sep 04, 2012 8:43 pm
by dick scherrer
Hello and welcome to the forum,

You might consider running a (probably SORT) process to insert the date into the data to be loaded. As you are specifying a file as input to the load, that would not require re-writing your load naming all of the columns.

How much data is to be loaded? If the answer is 100million rows, changing the LOAD might be better . . .

Re: Current Timestamp in LOAD JCL

PostPosted: Thu Sep 06, 2012 6:03 pm
by GuyC
I think the only way is to have the default for that column as current timestamp and not to include the column in the load.