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 

Keeping blanks with db2 load utility

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


Joined: 30 Jun 2006
Posts: 4
Topics: 2

PostPosted: Tue Jul 18, 2006 8:24 am    Post subject: Keeping blanks with db2 load utility Reply with quote

Hi,

I'm trying to write a JCL to load some data into db2 v7 for z/OS.
I have a column defined as
Code:
SCHEMA_DESC    VARCHAR (128) DEFAULT ' '   NOT NULL


In my load data all the rows of this column have spaces in them, however when I run the JCL I get error code 26 from the load utility- that the column is null. I think the load utility is trimming the blank spaces? Does anyone know how to stop this?

The JCL I'm using is:
Code:

//CDSYL    EXEC DSNUPROC,UID='P390',SYSTEM=DB8G
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=&&UT1,UNIT=SYSDA,
//         SPACE=(4096,(20,20),,,ROUND)
//SORTOUT  DD DSN=&&SOUT,UNIT=SYSDA,
//         SPACE=(4096,(20,20),,,ROUND)
//SYSIN    DD *
  LOAD DATA RESUME(YES)
  SHRLEVEL CHANGE
  FORMAT DELIMITED
  COLDEL '`' CHARDEL '@' DECPT '.'
  INTO TABLE SCHEMAS_TAB
  (
   SCHEMA_NAME           CHAR  (32),
   SCHEMA_DESC           CHAR  (32),
   INITIALIZED           CHAR   (1)
  )
  ;
/*
//SYSREC   DD DSN=&CODALD(SCHEMAS),DISP=SHR
//*


Thanks.
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 Jul 18, 2006 8:41 am    Post subject: Reply with quote

Elroy,

When you unloaded the data , the utility DSNTIAUL will also write out a load card in the SYSPUNCH dd. So use that output as load card instead of your own load card.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Jul 21, 2006 1:42 pm    Post subject: Reply with quote

Quote:
In my load data all the rows of this column have spaces in them
Unfortunately, that does not seem to be the case.

Try doing a FIND ALL if the file is not big. Or, use DFSORT to omit records having spaces and see how many records you get.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
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