Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2004
    Posts
    54

    Unanswered: 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

  2. #2
    Join Date
    Jun 2007
    Location
    germany
    Posts
    155
    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

  3. #3
    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.

  4. #4
    Join Date
    Apr 2005
    Location
    USA
    Posts
    130
    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

  5. #5
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    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

  6. #6
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •