(when the save suboption is used)
look ups
Properties
Property Normalmode Create-onlymode
Numberofinputdatasets T+1 T
Numberofoutputdatasets 1or2(outputandoptionalreject) 0 Inputinterfaceschema fromtheinputdatasetconcatenated rejectRec;*
key-fieldinformationisaddedtothe table
n/a
key-fieldinformationisaddedtothe table
Partitioningmethod any(parallelmode);thedefaultfor tableinputsisentire
any(defaultisentire)
Collectionmethod any(sequentialmode) any
Preserve-partitioningflaginoutput dataset
propagated n/a
Compositeoperator yes yes
Syntax and options
Termsinitalictypefaceareoption stringsyousupply.Whenyouroptionstringcontainsaspaceora tab character,youmustencloseitinsinglequotes.
Thesyntaxforthelookupoperatorinanoshcommandhastwoforms,dependingonwhetheryouare onlycreating oneormorelookuptablesordoingthelookup(matching)itselfand creatingfilesetsor usingexistingfilesets.
lookup -createOnly
-table -key field [-cs | -ci] [-param parameters]
[-key field [-cs | -ci] [-param parameters]...]
[-allow_dups]
–save lookup_fileset
[-diskpool pool]
[-table -key field [-cs | -ci] [-param parameters]
[-key field [-cs | -ci] [-param parameters]...]
[-allow_dups]
-save fileset_descriptor [-diskpool pool] ...]
or
lookup [-fileset fileset_descriptor]
[-collation_sequence locale |collation_file_pathname | OFF]
[-table key_specifications [-allow_dups]
-save fileset_descriptor
[-diskpool pool]...]
[-ifNotFound continue | drop | fail | reject]
whereafileset,ora table,orboth,mustbe specified,and key_specificationsisa listofoneormorestrings ofthisform:
-key field [-cs | -ci]
Option Use
-collation_sequence -collation_sequencelocale|collation_file_pathname|OFF Thisoptiondetermineshowyourstringdataissorted.
Youcan:
v
SpecifyapredefinedIBMICUlocale v
WriteyourowncollationsequenceusingICUsyntax, andsupplyitscollation_file_pathname
v SpecifyOFFsothatstringcomparisonsaremade usingUnicodecode-pointvalueorder,independentof anylocaleorcustomsequence.
Bydefault,WebSphereDataStagesortsstringsusing byte-wisecomparisons.
http://oss.software.ibm.com/icu/userguide/
Collate_Intro.html
-createOnly -createOnly
Specifiesthecreationofoneormorelookuptables;no lookupprocessingistobedone.
Option Use
-fileset [-filesetfileset_descriptor...]
Specifythenameofafilesetcontainingoneormore lookuptablestobematched.Thesearetablesthathave beencreatedandsavedbyanearlierexecutionofthe lookupoperatorusingthe-createOnlyoption.
Inlookupmode,youmustspecifyeitherthe-fileset option,oratablespecification,orboth,inorderto designatethelookuptable(s)tobematchedagainst.
Therecanbezeroormoreoccurrencesofthe-fileset option.Itcannotbespecifiedincreate-onlymode.
Warning:Thefilesetalreadycontainskeyspecifications.
Whenyoufollow-filesetfileset_descriptorby
key_specifications,thekeysspecifieddonotapplytothe fileset;rather,theyapplytothefirstlookuptable.For example,lookup-filesetfile-keyfield,isthesameas:
lookup-filesetfile1-table-keyfield
-ifNotFound -ifNotFoundcontinue|drop|fail|reject
Specifiestheoperatoractionwhenarecordofaninput datasetdoesnothaveacorrespondingrecordinevery inputlookuptable.Thedefaultactionoftheoperatoris tofailandterminatethestep.
continuetellstheoperatortocontinueexecutionwhena recordofaninputdatasetdoesnothavea
correspondingrecordineveryinputlookuptable.The inputrecordistransferredtotheoutputdatasetalong withthecorrespondingrecordsfromthelookuptables thatmatched.Thefieldsintheoutputrecord
correspondingtothelookuptable(s)withno
correspondingrecordaresettotheirdefaultvalueor nullifthefieldsupportsnulls.
droptellstheoperatortodroptheinputrecord(refrain fromcreatinganoutputrecord).
failsetstheoperatortoabort.Thisisthedefault.
rejecttellstheoperatortocopytheinputrecordtothe rejectdataset.Inthiscase,arejectoutputdatasetmust bespecified.
Option Use
-table -table-keyfield[-ci|-cs][-paramparameters][-keyfield
[-ci|cs][-paramparameters]...][-allow_dups]-save fileset_descriptor[-diskpoolpool]]...]
Specifiesthebeginningofalistofkeyfieldsandother specificationsforalookuptable.Thefirstoccurrenceof -tablemarksthebeginningofthekeyfieldlistforlookup table1;thenextoccurrenceof-tablemarksthebeginning ofthekeyfieldsforlookuptable2,etc.Forexample:
lookup-table-keyfield-table-keyfield
The-keyoptionspecifiesthenameofalookupkeyfield.
The-keyoptionmustberepeatediftherearemultiple keyfields.Youmustspecifyatleastonekeyforeach table.Youcannotuseavector,subrecord,ortagged aggregatefieldasalookupkey.
The-cisuboptionspecifiesthatthestringcomparisonof lookupkeyvaluesistobecaseinsensitive;the-csoption specifiescase-sensitivecomparison,whichisthedefault.
The-paramssuboptionprovidesextraparametersforthe lookupkey.Specifyproperty=valuepairs,withoutcurly braces.
Increate-onlymode,the-allow_dupsoptioncausesthe operatortosavemultiplecopiesofduplicaterecordsin thelookuptablewithoutissuingawarning.Twolookup recordsareduplicateswhenalllookupkeyfieldshave thesamevalueinthetworecords.Ifyoudonotspecify thisoption,WebSphereDataStageissuesawarning messagewhenitencountersduplicaterecordsand discardsallbutthefirstofthematchingrecords.
Innormallookupmode,onlyonelookuptable(specified byeither-tableor-fileset)canhavebeencreatedwith -allow_dupsset.
The-saveoptionletsyouspecifythenameofafilesetto writethislookuptableto;if-saveisomitted,tablesare writtenasscratchfilesanddeletedattheendofthe lookup.Increate-onlymode,-saveis,ofcourse,required.
The-diskpooloptionletsyouspecifyadiskpoolin whichtocreatelookuptables.Bydefault,theoperator looksfirstfora″lookup″diskpool,thenusesthedefault pool(″″).Usethisoptiontospecifyadifferentdiskpool touse.