-IGNORE(WHEN)-
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Database

#1: -IGNORE(WHEN)- Author: NASCAR9Location: California PostPosted: Fri Mar 11, 2016 12:49 pm
    —
I can't find an example how to -IGNORE(WHEN)- in my load job. I'm trying to bypass the first record if it's a title line. This is from IBM's site. No example on IBM's site grrr
Code:
-IGNORE(WHEN)-

Specifies that records that do not satisfy the WHEN clause will be ignored. If discarding is specified, records that do not satisfy the when clause will not be loaded, and will not be written to the DISCARD data set. If discarding is not specified, records that do not satisfy the WHEN clause do not cause the LOAD to terminate.
Use the record count messages in the Utility output to determine the number of records ignored.

My load statements

LOAD DATA INDDN(INDD1)                                   
     RESUME YES                                         
     DISCARDDN DISCARD DISCARDS 0                       
     IGNORE(WHEN)    --- I need to bypass if SSNO IS NOT NUMERIC
    FORMAT DELIMITED COLDEL X'05' CHARDEL '"' DECPT  '.'
     INTO TABLE MY.TABLE                         
          (SSNO                INTEGER                , 
           RET_TYPE            CHAR(02)               , 
           )                                             
     LOG NO
 

#2:  Author: kolusuLocation: San Jose PostPosted: Fri Mar 11, 2016 3:57 pm
    —
NASCAR9,

If you specify the FORMAT DELIMITED option, you cannot use any of the following options:
Code:

    CONTINUEIF
    INCURSOR
    Multiple INTO TABLE statements
    WHEN

#3:  Author: NASCAR9Location: California PostPosted: Fri Mar 11, 2016 5:10 pm
    —
That's too bad. Where did you find that information?
I added an OMIT to a sort to remove the record.
Thanks Kolusu.

#4:  Author: kolusuLocation: San Jose PostPosted: Fri Mar 11, 2016 5:54 pm
    —
NASCAR9 wrote:
That's too bad. Where did you find that information?
I added an OMIT to a sort to remove the record.
Thanks Kolusu.


Look under the description for DELIMITED in this link

https://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/com.ibm.db2z10.doc.ugref/src/tpc/db2z_loadsyntax.dita

It is strange that PDF versions of the manuals do not have this IGNORE(WHEN) info in both DB2 10 and 11 Versions.



MVSFORUMS.com -> Database


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group