View previous topic :: View next topic
Author
Message
prathmone New User Joined: 31 Jan 2022Posts: 2 Location: Germany
Hello All,
Can someone help me with the below issue -
While unloading data from DB2 tables using DSNUTILB utility, in case of COLUMNS with datatype DECIMAL(n, 0), there comes an extra '.' in the unloaded data.
How can we get rid of this extra '.'
Unload JCL -
//STEP1 EXEC PGM=DSNUTILB,PARM='TDB1'
//STEPLIB DD DSN='TEST.SDSNLIB',DISP=SHR
//SYSREC DD DSN=TEST.INPUT.TABLE1,
// DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(2,1))
//SYSPUNCH DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
UNLOAD DATA
FROM TABLE TABLE1
DELIMITED CHARDEL '"' COLDEL ','
Table Defination-
COL1 DECIMAL (1,0),
COL2 CHAR (3)
Current Unload -
1.,"ABC"
2.,"DEF"
3.,"GHI"
Expected Unload -
1,"ABC"
2,"DEF"
3,"GHI"
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2141 Location: USA
Code:
... FINDREP=(INOUT=(C'.,',C','))
Back to top
Joerg.Findeisen Senior Member Joined: 15 Aug 2015Posts: 1335 Location: Bamberg, Germany
sergeyken wrote:
Code:
... FINDREP=(INOUT=(C'.,',C','))
You perhaps should add to use SORT for that.
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2141 Location: USA
Joerg.Findeisen wrote:
sergeyken wrote:
Code:
... FINDREP=(INOUT=(C'.,',C','))
You perhaps should add to use SORT for that.
Furthermore: also //SYSOUT DD must be added, too!!
And: //SYSIN DD *
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2141 Location: USA
No reaction from TS (as usually...)
Keine Reaktion vom Themenstarter (wie üblich..)
Code:
//*================================================
//* Unload the table temporary as per DSNUTILB rules
//*================================================
//UNLOAD EXEC PGM=DSNUTILB,PARM='TDB1'
//STEPLIB DD DSN=TEST.SDSNLIB,DISP=SHR
//SYSREC DD DSN=&&TEMPTAB,
// DISP=(NEW,PASS),
// UNIT=SYSDA,SPACE=(TRK,(2,1))
//SYSPUNCH DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
UNLOAD DATA
FROM TABLE TABLE1
DELIMITED CHARDEL '"' COLDEL ','
//*
//*================================================
//* Fix (all) undesired formats in the intermediate dataset
//*================================================
//FIXDOTS EXEC PGM=SORT,COND=(0,NE,UNLOAD)
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&TEMPTAB,
// DISP=(OLD,DELETE)
//SORTOUT DD DSN=TEST.INPUT.TABLE1,
// DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(2,1))
//SYSIN DD *
INREC FINDREP=(INOUT=(C'.,',C','))
SORT FIELDS=COPY
END
//*
//*================================================
Back to top
prathmone New User Joined: 31 Jan 2022Posts: 2 Location: Germany
Ganz Herzlichen Dank sergeyken und Jörg.Findeisen !
Entschuldigung für die späte Antwort.
Back to top
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
Can you try DIGITS(col1) in your unload statement
Untested
Back to top
Please enable JavaScript!