Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Problem with Loading table with IDENTITY COLUMN ALWAYS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Tue Oct 07, 2008 7:30 pm    Post subject: Problem with Loading table with IDENTITY COLUMN ALWAYS
Reply with quote

Hi Guyz,

I am having a table with 2 Columns and one of them is a IDENTITY COLUMN with ALWAYS defined(ID). So the ID will be DB2 generated.
Iam suppose to load the other column DNAME, which is of CHAR(30).

So, only the DNAME column is UNLOADED and kept in a DATASET
For example UNLOAD file will be like this (with quotes)
Code:
'HUMAN RESOURCE                '
'HIRING                        '
'FIRING                        '
'FINANCE                       '
'MARKETING                     '
'PLANNING                      '


I need to load the table with these data.

Iam using FASTLOAD utility,

This is my PARMCARD
Code:
FASTLOAD               
COPY-BUFFERS 30         
SPACE-DEFN YES         
DISPLAY-STATUS 10000   
INPUT-FORMAT DELIMITED 
COMMA ';'               
IO-BUFFERS 60           
MAXTASKS 1             
NONLEAF-PCTFREE LEAF   
UNLOAD CONTINUE         
COLLECT-PDASTATS       
RESUME NO REPLACE       
RECLUSTER NO SORT-CLINDX
ENFORCE CONSTRAINTS     
STARTUP-ACCESS FORCE   
SORTSIZE 8M             
SORTNUM  6         
STOP-LIMIT 1       
UPDATE-CATSTATS ALL
VSAM-BUFFERS 96     


This is my loadcard
Code:
INTO TABLE  HXSULL.DEPARTMENT                                         
 (                                                                   
  DNAME                          POSITION(            1:          30 )
    CHAR               (    30)                                       
 )                                                                   



This is error i am getting,
Code:
Object SHANDB.SIMPLETS in STOP PENDING Mode - Utility will Retry
Column(s) defined as GENERATED ALWAYS.  Each datum in           
a column of this type must be generated, not loaded.           
FASTLOAD application did not complete successfully             


The thing is iam not loading the IDENTITY COLUMN. I am only loading the DNAME. Assuming the ID column will be automatically generated.

How to load this table ?

HELP ME!
Sushanth Bobby
Back to top
View user's profile Send private message

sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Wed Oct 08, 2008 1:47 pm    Post subject:
Reply with quote

Hello to anyone,

I have found a way to load a table with IDENTITY column using IBM LOAD.

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.ugref/db2z_loadtableidentitycolumnsrowid.htm

But, i am using PLATINUM TOOL, is there any syntax for this

Thank You in Advance,
Sushanth Bobby
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Fri Oct 10, 2008 12:09 pm    Post subject:
Reply with quote

Hello,
I have found out a way to load the tables with IDENTITY COLUMNS using unload file in SEQUENTIAL Datasets(ouput in unload & input in load)

1. Unload the only the columns which you want to load(exclude identity columns)
2. Prepare the LOAD CARDS for loading the Data.(Identity column will be having a dummy prefix).
Code:
INTO TABLE  HXSULL.DEPARTMENT                                         
 (                                                                   
  DUMMY_IDENT_00001              POSITION(            1:           4 )
    INTEGER                                                           
   ,                                                                 
  DNAME                          POSITION(            5:          34 )
    CHAR               (    30)                                       
 )                                                                   



3. Load the table.

That's it.

But my prob is similar but entirely different.
This is my scenario,
Input Table : Has 2 columns
Code:
      Column 1 : ID    - Identity Column
      Column 2 : Dname - Char(30)

1. I have unloaded only the Dname column from the input-table, using output format delimited-comma comma ';'

unload file will be like

Code:
'AAAAAAAAAAAAAAA                '
'AAAAAAAAAAAAAAA          BCD   '
'AAAAAAAAAAAAAAA          III   '

2. Same LoadCards


3. In Loading process i have specified, input-format delimited comma ';'

This actually, should have worked. It didn't.

Same error which i had previously. Shouldn't load identity column. But, i am not loading the identity column.
1. I am unloading only the DNAME column
2. LoadCards has a dummy prefix, so that i won't be loading any data there.
3. In the load process input-format is delimited comma ';'

Help Needed,
Sushanth
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts Need inputs on DB2 tablespace/table r... ashek15 DB2 3 Sat Mar 24, 2018 11:49 pm
No new posts Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am
No new posts COBOL declaration for table Poha Eater DB2 3 Mon Feb 26, 2018 6:58 pm
No new posts load and delete table through JCL wit... ram_vizag JCL & VSAM 9 Thu Feb 01, 2018 12:47 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us