kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Sun May 02, 2004 9:52 pm Post subject: |
|
|
Murali,
Please follow the rules. Avoid putting "urgent" or "urgently" in your topics. Sort products till date have no ability of producing the micro seconds portion in the time stamp. The micro seconds is a number between 0 and 99999. But you can eitehr default a value like '000000' to the micro seconds portion or generate dynamically by assigning a sequence number of sort.
You haven't provided any details like lrecl and recfm of your input file. Assuming that your input file is of lrecl=80 and recfm=fb, the following jcl will give you the desired results.
Solution: 1
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y,),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,80,DATE4,C'.',SEQNUM,6,ZD)
/*
|
If you get an error on DATE4 parm then you are probably using an older version of DFSORT. try this job.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y,),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,80,DATE=(4MD-),C'-',TIME(24.),C'.',SEQNUM,6,ZD)
/*
|
If you still get an error on date field then you are probably using the OLDEST version of sort available.Then in that case you can try this job.
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//NULL DD *
DUMMY RECORD
//IN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//T1 DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//OUT DD DSN=YOUR OUTPUT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y,),RLSE)
//TOOLIN DD *
COPY FROM(NULL) USING(CTL1)
COPY FROM(T1) USING(CTL2)
COPY FROM(IN) TO(OUT) USING(CTL3)
//CTL1CNTL DD *
OUTFIL FNAMES=T1,NODETAIL,
HEADER1=(DATE=(4MD-),'-',TIME(24.))
//CTL2CNTL DD *
OUTFIL FNAMES=CTL3CNTL,
OUTREC=(C' OUTREC FIELDS=(1,80,',C'C''',2,19,
C'.''',C',SEQNUM,6,ZD',C')',80:X)
/*
|
If none of the jobs work then you better code a cobol program beacuse you are having a sort version that can be refered as very very old. I don't know what features it supports.
However on the flip side if you have the latest version of syncsort z/os with the latest feature of db2 support then the following JCL will give you the timestamp as in db2. The first step unloads the timestamp from db2 and creates a control card for the next sort step.
Code: |
//STEP0100 EXEC PGM=SORT,PARM='DB2=YOUR DB2 REGION'
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTDBIN DD *
SELECT CHAR(' OUTREC FIELDS=(1,80,C''')
,CURRENT TIMESTAMP
,CHAR(''')')
,CHAR(' ')
FROM
SYSIBM.SYSDUMMY1
//SORTOUT DD DSN=USERID.UNLOAD.TIMESTMP,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE)
//*
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y,),RLSE)
//SYSIN DD DSN=USERID.UNLOAD.TIMESTMP,DISP=OLD
//$ORTPARM DD *
OPTION COPY
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|