MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unload CLOB in readable format

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
rkinfy
Beginner


Joined: 12 Nov 2010
Posts: 11
Topics: 3

PostPosted: Mon Nov 22, 2010 5:02 am    Post subject: Unload CLOB in readable format Reply with quote

I'm trying to unload CLOB data from a table to file using DB2 utility. But the data is not in readable format. Is there a way to get the data in readable format?
_________________
RK.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Nov 22, 2010 6:43 am    Post subject: Reply with quote

what do you mean 'readable format'?

CLOB data is normally 'as is'.

what is contained in your CLOB?
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
rkinfy
Beginner


Joined: 12 Nov 2010
Posts: 11
Topics: 3

PostPosted: Tue Nov 23, 2010 1:25 am    Post subject: Reply with quote

Hi Dick,

Here's what I got using the IBM Utility.


Data in the table (Extracted using a normal query)

********************************* Top of Data **********************************
EducationalData xmlns:ps="http://www.ibm.com/mdm/metadata/spec/EducationalData/i


Data in the unloaded file
_________________
RK.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Nov 23, 2010 3:49 am    Post subject: Reply with quote

what is the CSID of the CLOB.

it appears that you have ANSCII data stored in your CLOB column,
your 'normal query' takes into account the CCSID of the data,
your unload does not.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
rkinfy
Beginner


Joined: 12 Nov 2010
Posts: 11
Topics: 3

PostPosted: Tue Nov 23, 2010 6:55 am    Post subject: Reply with quote

Thanks for the input Dick.

I changed the job to include EBCDIC CCSID(00037,00037,01200) parameter. I'm getting the data in the readable format.

But each row in the table is coming as a separate member in a PDS. Is there any way to get the data in a PS file?
_________________
RK.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Tue Nov 23, 2010 11:23 am    Post subject: Reply with quote

rkinfy wrote:
But each row in the table is coming as a separate member in a PDS. Is there any way to get the data in a PS file?


rkinfy,

What DB2 Unload utility are you using to unload the data? Post the JCL


Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rkinfy
Beginner


Joined: 12 Nov 2010
Posts: 11
Topics: 3

PostPosted: Wed Nov 24, 2010 2:54 am    Post subject: Reply with quote

Hi Kolusu,

Please find below the JCL used.
Code:

//XXXXXXXB JOB (XXXX),'CLOB UNLOAD',NOTIFY=&SYSUID,CLASS=0,MSGCLASS=X
//*                                                                 
// SET Q1=XXXX,Q2=UNL00038                                           
// SET DB2SS=XXXX                                                   
//*                                                                 
//BR14 EXEC PGM=IEFBR14                                             
//FILE01 DD DSN=&Q1..SIEBEL.&Q2..UNLOAD,                             
// DISP=(MOD,DELETE,DELETE),SPACE=(CYL,5)                           
//*                                                                 
//UNLCLB EXEC PGM=DSNUTILB,PARM=('&DB2SS','&Q2'),                   
// REGION=0M                                                         
//STEPLIB DD DISP=SHR,DSN=XXXX.DB2.DSNLOAD                           
//ABNLIGNR DD DUMMY                                                 
//DSSPRINT DD SYSOUT=*                                               
//SYSPRINT DD SYSOUT=*                                               
//SYSUDUMP DD SYSOUT=*                                               
//UTPRINT DD SYSOUT=*                                               
//RNPRIN01 DD SYSOUT=*                     
//STPRIN01 DD SYSOUT=*                     
//SYSOUT DD SYSOUT=*                       
//SYSIN DD *                               
 TEMPLATE LOBFRV DSN 'XXXX.CLOBUNLD.TEST'   
 UNIT(SYSDA)                               
 UNLOAD DATA                               
 FROM TABLE XXXXX.CONTACTDEMOGRAPHICS       
 (CONT_ID, VALUE VARCHAR(2000) CLOBF LOBFRV)
 SHRLEVEL CHANGE                           
 NOPAD EBCDIC CCSID(00037,00037,01200)     
/*                                         
//SYSREC DD DSN=&Q1..SIEBEL.&Q2..UNLOAD,   
// DISP=(NEW,CATLG,CATLG),                 
// SPACE=(CYL,(10,30),RLSE),               
// UNIT=SYSDA                               
//SYSPUNCH DD DUMMY                         
//*

_________________
RK.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Wed Nov 24, 2010 11:33 am    Post subject: Reply with quote

rkinfy,

You are using a template named LOBFRV. You need to find out how that template is defined. I am guessing that the template is defined as a PDS instead of sequential dataset. Read here about the template option

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnugj12/2.29?

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rkinfy
Beginner


Joined: 12 Nov 2010
Posts: 11
Topics: 3

PostPosted: Thu Nov 25, 2010 4:11 am    Post subject: Reply with quote

Thanks Kolusu. I removed the TEMPLATE and LOBFRV parameters. It is giving the data in a readable format now.
Code:

UNLOAD DATA                         
FROM TABLE XXXXX.CONTACTDEMOGRAPHICS
(CONT_ID, VALUE VARCHAR(2000) CLOB )
SHRLEVEL CHANGE                     
NOPAD EBCDIC CCSID(00037,00037,01200)

Thanks again!!
_________________
RK.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group