If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Import from gdg+1?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-03-10, 14:24
goldfishhh goldfishhh is offline
Registered User
 
Join Date: Nov 2004
Posts: 54
Import from gdg+1?

Im in the process of setting up a few queries to import generated data into my database. I'd like to read directly from the filesystem. I've read the import command syntax and came up with this:

Aside from this not working at all, where am I going wrong?

IMPORT FROM 'I266217.I234.AUDITEXT(+1)'
OF ASC
METHOD L (14 22,7 13,32 38)
INSERT INTO TOTDB01.PROD_SUCC
(
STRT_DT_DT,
JOB_TXT,
PROD_JOB_ABEND_ID
)
;
COMMIT ;
---------+---------+---------+---------+---------+---------+---------+-------
DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL "IMPORT". SOME SYMBOLS THAT
MIGHT BE LEGAL ARE: <ERR_STMT> <WNG_STMT> GET SQL SAVEPOINT HOLD FRE
ASSOCIATE
DSNT418I SQLSTATE = 42601 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNHPARS SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = 3 0 0 -1 1 502 SQL DIAGNOSTIC INFORMATION
Reply With Quote
  #2 (permalink)  
Old 06-03-10, 14:35
dbzTHEdinosaur dbzTHEdinosaur is offline
Registered User
 
Join Date: Jun 2007
Location: germany
Posts: 96
don't know anything about the IMPORT (other than I have seen it in QMF and DFSMS)
but
after you get this working
often using a relative gen number will not work, you need the absolute file name for many utilities.
__________________
Dick Brenholtz, Ami in Deutschland
Reply With Quote
  #3 (permalink)  
Old 06-03-10, 14:50
goldfishhh goldfishhh is offline
Registered User
 
Join Date: Nov 2004
Posts: 54
What methods are you using to add data to a table which may be in an absolute file on the mainframe? I can easily do this in Windows (c:\blah\stuff.csv) but just don't know how to tell the sql code to get the data from a file.
Reply With Quote
  #4 (permalink)  
Old 06-03-10, 14:54
schintala schintala is offline
Registered User
 
Join Date: Apr 2005
Location: USA
Posts: 119
You can not use the import command to load the data in z/OS. Import works only in LUW versions. Alternately try using load command in z/OS
Reply With Quote
  #5 (permalink)  
Old 06-03-10, 15:04
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
or as was mentioned QMF can do it in a roundabout fashion, using import data, save data as, then insert select from. You can use rexx to read a file in, think there is something on Code place to do this. Quite a number of methods.
Dave Nance
Reply With Quote
  #6 (permalink)  
Old 06-04-10, 06:40
tibullo tibullo is offline
Registered User
 
Join Date: Dec 2004
Location: Italy
Posts: 32
Goldfishhh, you may use this type of table loading from a DB2 Connect or a DB2 LUW instance connected to the z/OS DB2 by DRDA and it is extremely helpful when you have to load LOBs. One problem is that in such a situation you cannot use the gdg, but a flat file your DB2 instance can read.

Just one note about GDG... you cannot read from a gdg(+1) because such a syntax is used to add a new gdg version. The correct syntax should be reading from a gdg(0), that means the last gdg version available, or gdg(-1), gdg(-2)... for the previous ones.

Good luck.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On