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
 
Different possibbilites of Loading DB2 Tables

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Rathinakara Raj
Warnings : 1

New User


Joined: 19 Jan 2007
Posts: 5
Location: Richmond

PostPosted: Fri Jan 19, 2007 11:16 pm    Post subject: Different possibbilites of Loading DB2 Tables
Reply with quote

Hi ,

Could any one of you tell me the different possibbilites to load DB2 tables ?

Thanks,
Rathinakar.
Back to top
View user's profile Send private message

vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Sat Jan 20, 2007 1:04 am    Post subject: Hello Rathinakara
Reply with quote

1) IF THE UTILITY IS TO LOAD THE INPUT DATA INTO AN EMPTY TABLE
THEN WE SAY LOAD INTO TABLE TABLE_NAME.

2)IF THE UTILITY HAS ROWS IN IT CODE LOAD RESUME YES IF YOU WANT THE NEW ROWS ADDED TO THE END OF THE table.

3) IF YOU WANT TO REPLACE THE CURRENT DATA WITH THE NEW INPUT DATA CODE REPLACE AS LOAD REPLACE INTO TABLE TABLE_NAME.

WHEN THE UTILITY IS RUNNING U CAN PROVIDE VARIOUS ACCESS MODES
TO THE TABLE SPACE
ACCESS = RO -READ ONLY OPTION
ACCESS = RW -READ/WRITE OPTION .THIS IS THE DEFAULT ACCESS MODE
ACCESS = UT -PERMITS ACCESS TO UTILITIES ONLY.
ACCESS = FORCE - WILL START THE DATABASE WITHE ACCESS = R/W

DURING THE LOADING PROCESS THERE IS AN OPTION TO SET TE LOG FLAG TO YES OR NO. THE LOG PARAMETER BASICALLY KEEPS TRACKS OF WHETHER THE LOG RECORDS ARE WRITTEN DURING THE EXECUTION OF THE UTILITY.
IF LOG = YES LOG RECORDS ARE WRITTEN.
IF LOG = NO LOG RECORDS ARE NOT WRITTEN.DB2 WILL AUTOMATICALLY SET THE COPY PENDING FLAG TO YES.THIS IS DONE SO THAT NO MATTER WHAT DB2 HAS AN IMAGE COPY OF THE TABLE SPACE BEFORE THE UTILITY RUNS .
IF YOU HAVE LOG = NO AND WANT TO AVOID THE COPY STEP THEN U CAN USE ACCESS= FORCE WHICH WILL CHANGE THE STATUS OF THE TABLESPACE TO R/W
Back to top
View user's profile Send private message
Rathinakara Raj
Warnings : 1

New User


Joined: 19 Jan 2007
Posts: 5
Location: Richmond

PostPosted: Sat Jan 20, 2007 1:32 am    Post subject: thanks
Reply with quote

Thanks for the detailed Reply.Do you know anyother ways you back up tables ?
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Sat Jan 20, 2007 1:43 am    Post subject:
Reply with quote

1) You can load the table using JCL

2) you can also load the table from File-Aid / Insync
Back to top
View user's profile Send private message
Rathinakara Raj
Warnings : 1

New User


Joined: 19 Jan 2007
Posts: 5
Location: Richmond

PostPosted: Sat Jan 20, 2007 2:23 am    Post subject: Backing up tables
Reply with quote

Hi,

How do you do it "IMAGECOPY" ??.

Thanks,
Rathinakar.
Back to top
View user's profile Send private message
komal

New User


Joined: 09 May 2005
Posts: 18

PostPosted: Sat Jan 20, 2007 1:15 pm    Post subject: Re: Different possibbilites of Loading DB2 Tables
Reply with quote

Hello Madhuri,

I found a lot useful expln in ur reply and i'm attaching one more query which falls in the same.

In a DB2 table, different columns r there like

a char(5),
b char(3),
c char(3),
d dec(19,8) - nullable,
e char(100) - nullable,
f char(100) - nullable,
g char(100),
h char(5)

when i extracted the table into a flat file, i got the LOAD form as

LOAD DATA RESUME YES INTO TABLE "KOMAL"."KIRAN"
(A POSITION (7) CHAR (5) ,
B POSITION (12) CHAR (3) ,
C POSITION (15) CHAR (3) ,
D_NUM POSITION (18:27) DEC
NULLIF (1:2)=X'FFFF' ,
E POSITION (28) CHAR (100)
NULLIF (3:4)=X'FFFF' ,
F POSITION (128) CHAR (100)
NULLIF (5:6)=X'FFFF' ,
G POSITION (228) CHAR (100) ,
H POSITION (328) CHAR (5) )

In the flat file i found that the values in 'D' r displayed as special symbols.
The text file which I FTPied from flat file contain the same.

I have 2 doubts here

1. If I am not wrong, the size of that D is 10 bytes so, it is displaying some special symbols for some value like 12345678901.12345678. But how to get the actual value into the flat file instead of special symbols?

2. My source system is sending us a textfille which i have to load into the DB2 table mentioned above. How i can move the actual decimal value from the text file to the column D of the table?

PLZ reply me as soon as possible bcoz i am fighting with this from last 2 days.

KiranChand
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Jan 21, 2007 8:21 am    Post subject:
Reply with quote

Hello,

In TSO, open your text file in Browse. Then set HEX ON.

You will see what the "special" symbols are - packed decimal numbers often show as "special" symbols - they sometimes contain hex values that are "printable". Copy a few of these expanded lines (showing the text line and the 2 hex lines) as "code" to a reply here (to make it readable on the forum). It sounds like the text file has what you need to load, but looking at a few records in the text file will surely verify that.

It will also help you to get the copybook or other file definition from the program that created the text file. Please post the text file layout when you find it.

I'll check back later tonight to see if you've posted anything.
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Tue Jan 23, 2007 12:31 am    Post subject: Hello,
Reply with quote

If u have special symbols in the field it implys there are packed decimal numbers.
U have to open the file in only in the hex mode(In the command prompt type HEN ON) to see what the actual values are.

For the second question I think first u have to create a flat file from the text file Then u have to code e in u r load utility u r sysin will conatin something like

LOAD REPLACE LOG(NO)
INTO TABLE xxxxxx
(
C_SC_FAM POSITION(0002) CHAR
,C_SC_PLAN POSITION(0006) CHAR
,C_STATE POSITION(0015) CHAR
,D_EFFCTV POSITION(0018) DATE EXTERNAL
,D_EXPRN POSITION(0029) DATE EXTERNAL
,C_PLAN_PROVSN POSITION(0040) CHAR
,C_PLAN_STAT POSITION(0049) CHAR
)

Put in the apropiate load option and the fields with their respective data type.
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 Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts loading a Modified Mapset Susanta CICS 2 Tue Mar 14, 2017 5:43 pm

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