ServiceLibraryReference.xml 254 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994
  1. <?xml version="1.0"?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
  3. <book lang="en_US">
  4. <bookinfo>
  5. <author>
  6. <surname>Greg Panagiotatos</surname>
  7. </author>
  8. <date>2010-12-17</date>
  9. </bookinfo>
  10. <chapter id="Service_Library_Reference">
  11. <title>Service Library Reference</title>
  12. <sect1 id="String_Handling">
  13. <title><emphasis>String Handling</emphasis></title>
  14. <para></para>
  15. <para></para>
  16. <sect2 id="CleanSpaces">
  17. <title><emphasis>CleanSpaces</emphasis></title>
  18. <para><emphasis role="bold">StringLib.StringCleanSpaces(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeCleanSpaces(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis></para>
  19. <para><emphasis>source</emphasis> A string containing the data to
  20. clean.</para>
  21. <para>Return:<emphasis> </emphasis>CleanSpaces returns either a STRING
  22. or UNICODE value, as appropriate.</para>
  23. <para>All variations of the <emphasis role="bold">CleanSpaces
  24. </emphasis>function return the <emphasis>source</emphasis> string with
  25. all instances of multiple adjacent space characters (2 or more spaces
  26. together, or a tab character) reduced to a single space character. It
  27. also trims off all leading and trailing spaces.</para>
  28. <para>Example:</para>
  29. <programlisting>A := StringLib.StringCleanSpaces('ABCDE ABCDE');
  30. //A contains 'ABCDE ABCDE'
  31. UNICODE C := UnicodeLib.UnicodeCleanSpaces(U'ABCDE ABCDE'); //C contains U'ABCDE ABCDE'
  32. </programlisting>
  33. <para></para>
  34. </sect2>
  35. <sect2 id="CompareAtStrength">
  36. <title><emphasis>CompareAtStrength</emphasis></title>
  37. <para><emphasis role="bold">UnicodeLib.UnicodeCompareAtStrength(</emphasis><emphasis>source1,
  38. source2, strength</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeLocaleCompareAtStrength(</emphasis><emphasis>source1,source2,locale,strength</emphasis><emphasis role="bold">)</emphasis></para>
  39. <para><emphasis>source1</emphasis> A string containing the data to
  40. compare.</para>
  41. <para><emphasis>source2</emphasis> A string containing the data to
  42. compare.</para>
  43. <para><emphasis>strength</emphasis> An integer value indicating how to
  44. compare. Valid values are:</para>
  45. <para>1 ignores accents and case, differentiating only between
  46. letters.</para>
  47. <para>2 ignores case but differentiates between accents.</para>
  48. <para>3 differentiates between accents and case but ignores e.g.
  49. differences between Hiragana and Katakana</para>
  50. <para>4 differentiates between accents and case and e.g.
  51. Hiragana/Katakana, but ignores e.g. Hebrew cantellation marks</para>
  52. <para>5 differentiates between all strings whose canonically
  53. decomposed forms (NFD—Normalization Form D) are non-identical</para>
  54. <para><emphasis>locale</emphasis> A null-terminated string containing
  55. the language and country code to use to determine correct sort order
  56. and other operations.</para>
  57. <para>Return:<emphasis> </emphasis>CompareAtStrength returns an
  58. INTEGER value.</para>
  59. <para>The <emphasis role="bold">CompareAtStrength </emphasis>functions
  60. return zero (0) if the <emphasis>source1</emphasis> and
  61. <emphasis>source2</emphasis> strings contain the same data, ignoring
  62. any differences in the case of the letters. These functions return
  63. negative one (-1) if <emphasis>source1</emphasis> &lt;
  64. <emphasis>source2</emphasis> or positive one (1) if
  65. <emphasis>source1</emphasis> &gt; <emphasis>source2</emphasis>.</para>
  66. <para>Example:</para>
  67. <programlisting>base := u'caf\u00E9'; // U+00E9 is lowercase e with acute
  68. prim := u'coffee shop'; // 1st difference, different letters
  69. seco := u'cafe'; // 2nd difference, accents (no acute)
  70. tert := u'Caf\u00C9'; // 3rd, caps (U+00C9 is u/c E + acute)
  71. A := unicodeLib.UnicodeCompareAtStrength(base, prim, 1) != 0;
  72. // base and prim differ at all strengths
  73. A := unicodeLib.UnicodeCompareAtStrength(base, seco, 1) = 0;
  74. // base and seco same at strength 1 (differ only at strength 2)
  75. A := unicodeLib.UnicodeCompareAtStrength(base, tert, 1) = 0;
  76. // base and tert same at strength 1 (differ only at strength 3)
  77. A := unicodeLib.UnicodeCompareAtStrength(base, seco, 2) != 0;
  78. // base and seco differ at strength 2
  79. A := unicodeLib.UnicodeCompareAtStrength(base, tert, 2) = 0;
  80. // base and tert same at strength 2 (differ only at strength 3)
  81. A := unicodeLib.UnicodeCompareAtStrength(base, seco, 3) != 0;
  82. // base and seco differ at strength 2
  83. A := unicodeLib.UnicodeCompareAtStrength(base, tert, 3) != 0;
  84. // base and tert differ at strength 3
  85. </programlisting>
  86. </sect2>
  87. <sect2 id="CompareIgnoreCase">
  88. <title><emphasis>CompareIgnoreCase</emphasis></title>
  89. <para><emphasis role="bold">StringLib.StringCompareIgnoreCase(</emphasis><emphasis>source1,source2</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeCompareIgnoreCase(</emphasis><emphasis>source1,source2</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeLocaleCompareIgnoreCase(</emphasis><emphasis>source1,source2,
  90. locale</emphasis><emphasis role="bold">)</emphasis></para>
  91. <para><emphasis>source1</emphasis> A string containing the data to
  92. compare.</para>
  93. <para><emphasis>source2</emphasis> A string containing the data to
  94. compare.</para>
  95. <para><emphasis>locale</emphasis> A null-terminated string containing
  96. the language and country code to use to determine correct sort order
  97. and other operations.</para>
  98. <para>Return:<emphasis> </emphasis>CompareIgnoreCase returns an
  99. INTEGER value.</para>
  100. <para>The <emphasis role="bold">CompareIgnoreCase </emphasis>functions
  101. return zero (0) if the <emphasis>source1</emphasis> and
  102. <emphasis>source2</emphasis> strings contain the same data, ignoring
  103. any differences in the case of the letters. These functions return
  104. negative one (-1) if <emphasis>source1</emphasis> &lt;
  105. <emphasis>source2</emphasis> or positive one (1) if
  106. <emphasis>source1</emphasis> &gt; <emphasis>source2</emphasis>.</para>
  107. <para>Example:</para>
  108. <programlisting>A := StringLib.StringCompareIgnoreCase('ABCDE','abcde');
  109. //A contains 0 -- they “match”
  110. B := StringLib.StringCompareIgnoreCase('ABCDE','edcba');
  111. //B contains -1 -- they do not “match”
  112. </programlisting>
  113. </sect2>
  114. <sect2 id="Contains">
  115. <title><emphasis>Contains</emphasis></title>
  116. <para><emphasis role="bold">StringLib.StringContains(</emphasis><emphasis>source,
  117. pattern, nocase</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeContains(</emphasis><emphasis>source,
  118. pattern, nocase</emphasis><emphasis role="bold">)</emphasis></para>
  119. <para><emphasis>source</emphasis> A string containing the data to
  120. search.</para>
  121. <para><emphasis>pattern</emphasis> A string containing the characters
  122. to compare. An empty string ( ‘’ ) always returns true.</para>
  123. <para><emphasis>nocase</emphasis> A boolean true or false indicating
  124. whether to ignore the case.</para>
  125. <para>Return:<emphasis> </emphasis>Contains returns a BOOLEAN
  126. value.</para>
  127. <para>The <emphasis role="bold">Contains </emphasis>functions return
  128. true if all the characters in the <emphasis>pattern</emphasis> appear
  129. in the <emphasis>source, </emphasis>otherwise they return
  130. false.</para>
  131. <para>Example:</para>
  132. <programlisting>A := stringlib.stringContains(
  133. 'the quick brown fox jumps over the lazy dog',
  134. 'ABCdefghijklmnopqrstuvwxyz', true);
  135. B:= stringlib.stringContains(
  136. 'the speedy ochre vixen leapt over the indolent retriever',
  137. 'abcdefghijklmnopqrstuvwxyz', false);
  138. </programlisting>
  139. <para></para>
  140. </sect2>
  141. <sect2 id="Data2String">
  142. <title><emphasis>Data2String</emphasis></title>
  143. <para><emphasis role="bold">StringLib.Data2String(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis></para>
  144. <para><emphasis>source</emphasis> A DATA string to convert.</para>
  145. <para>Return:<emphasis> </emphasis>Data2String returns a STRING
  146. value.</para>
  147. <para>The <emphasis role="bold">Data2String </emphasis>function
  148. returns a string containing the hexadeciomal characters from the
  149. <emphasis>source</emphasis> DATA value.</para>
  150. <para>Example:</para>
  151. <programlisting>DATA2 CrLf := x’0A0D’; //2-bytes of hex
  152. STRING4 CrLfString := StringLib.Data2String(CrLf); //results in a ‘0A0D’ 4-byte string
  153. </programlisting>
  154. <para></para>
  155. </sect2>
  156. <sect2 id="EditDistance">
  157. <title><emphasis>EditDistance</emphasis></title>
  158. <para><emphasis role="bold">StringLib.EditDistance(</emphasis><emphasis>string1,
  159. string2</emphasis><emphasis role="bold">)</emphasis></para>
  160. <para><emphasis>string1</emphasis> The first of a pair of strings to
  161. compare.</para>
  162. <para><emphasis>string2</emphasis> The second of a pair of strings to
  163. compare.</para>
  164. <para>Return:<emphasis> </emphasis>EditDistance returns an UNSIGNED4
  165. value.</para>
  166. <para>The <emphasis role="bold">EditDistance </emphasis>function
  167. returns a standard Levenshtein distance algorithm score for the edit
  168. ditance between <emphasis>string1</emphasis> and
  169. <emphasis>string2</emphasis>. This score i\reflects the minimum number
  170. of operations needed to transform <emphasis>string1</emphasis> into
  171. <emphasis>string2</emphasis>.</para>
  172. <para>.</para>
  173. <para>Example:</para>
  174. <programlisting>StringLib.EditDistance('CAT','CAT'); //returns 0
  175. StringLib.EditDistance('CAT','BAT'); //returns 1
  176. StringLib.EditDistance('BAT','BAIT'); //returns 1
  177. StringLib.EditDistance('CAT','BAIT'); //returns 2
  178. </programlisting>
  179. </sect2>
  180. <sect2 id="Extract">
  181. <title><emphasis>Extract</emphasis></title>
  182. <para><emphasis role="bold">StringLib.StringExtract(</emphasis><emphasis>source,
  183. instance</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeExtract(</emphasis><emphasis>source,
  184. instance</emphasis><emphasis role="bold">)</emphasis></para>
  185. <para><emphasis role="bold">source</emphasis><emphasis role="bold"> A
  186. string containing a comma-delimited list of data.</emphasis></para>
  187. <para><emphasis>instance </emphasis>An integer specifying the ordinal
  188. position of the data item within the <emphasis>source</emphasis> to
  189. return.</para>
  190. <para>Return:<emphasis> </emphasis>Extract returns either a STRING or
  191. UNICODE value, as appropriate.</para>
  192. <para>The <emphasis role="bold">Extract </emphasis>function returns
  193. the data at the ordinal position specified by the <emphasis>instance
  194. </emphasis>within the comma-delimited <emphasis>source</emphasis>
  195. string.</para>
  196. <para>Example:</para>
  197. <programlisting>//all these examples result in 'Success'
  198. A := IF(StringLib.StringExtract('AB,CD,,G,E',0) = '',
  199. 'Success',
  200. 'Failure -1');
  201. B := IF(StringLib.StringExtract('AB,CD,,G,E',1) = 'AB',
  202. 'Success',
  203. 'Failure -2');
  204. C := IF(StringLib.StringExtract('AB,CD,,G,E',2) = 'CD',
  205. 'Success',
  206. 'Failure -3');
  207. D := IF(StringLib.StringExtract('AB,CD,,G,E',3) = '',
  208. 'Success',
  209. 'Failure -4');
  210. E := IF(StringLib.StringExtract('AB,CD,,G,E',4) = 'G',
  211. 'Success',
  212. 'Failure -5');
  213. F := IF(StringLib.StringExtract('AB,CD,,G,E',5) = 'E',
  214. 'Success',
  215. 'Failure -6');
  216. G := IF(StringLib.StringExtract('AB,CD,,G,E',6) = '',
  217. 'Success',
  218. 'Failure -7');
  219. </programlisting>
  220. </sect2>
  221. <sect2 id="Filter">
  222. <title><emphasis>Filter</emphasis></title>
  223. <para><emphasis role="bold">StringLib.StringFilter(</emphasis><emphasis>source,
  224. filterstring</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeFilter(</emphasis><emphasis>source,
  225. filterstring</emphasis><emphasis role="bold">)</emphasis></para>
  226. <para><emphasis>source</emphasis> A string containing the data to
  227. filter.</para>
  228. <para><emphasis>filterstring </emphasis>A string containing the
  229. characters to use as the filter.</para>
  230. <para>Return:<emphasis> </emphasis>Filter returns a STRING or UNICODE
  231. value, as appropriate.</para>
  232. <para>The <emphasis role="bold">StringFilter </emphasis>functions
  233. return the <emphasis>source</emphasis> string with all the characters
  234. except those in the <emphasis>filterstring </emphasis>removed.</para>
  235. <para>Example:</para>
  236. <programlisting>//all these examples result in 'Success'
  237. A := IF(StringLib.StringFilter('ADCBE', 'BD') = 'DB',
  238. 'Success',
  239. 'Failure - 1');
  240. B := IF(StringLib.StringFilter('ADCBEREBD', 'BDG') = 'DBBD',
  241. 'Success',
  242. 'Failure - 2');
  243. C := IF(StringLib.StringFilter('ADCBE', '') = '',
  244. 'Success',
  245. 'Failure - 3');
  246. D := IF(StringLib.StringFilter('', 'BD') = '',
  247. 'Success',
  248. 'Failure - 4');
  249. E := IF(StringLib.StringFilter('ABCDE', 'EDCBA') = 'ABCDE',
  250. 'Success',
  251. 'Failure - 5');
  252. </programlisting>
  253. </sect2>
  254. <sect2 id="FilterOut">
  255. <title><emphasis>FilterOut</emphasis></title>
  256. <para><emphasis role="bold">StringLib.StringFilterOut(</emphasis><emphasis>source,
  257. filterstring</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeFilterOut(</emphasis><emphasis>source,
  258. filterstring</emphasis><emphasis role="bold">)</emphasis></para>
  259. <para><emphasis>source</emphasis> A string containing the data to
  260. filter.</para>
  261. <para><emphasis>filterstring </emphasis>A string containing the
  262. characters to use as the filter.</para>
  263. <para>Return:<emphasis> </emphasis>FilterOut returns a STRING or
  264. UNICODE value, as appropriate.</para>
  265. <para>The <emphasis role="bold">FilterOut </emphasis>functions return
  266. the <emphasis>source</emphasis> string with all the characters in the
  267. <emphasis>filterstring </emphasis>removed.</para>
  268. <para>Example:</para>
  269. <programlisting>//all these examples result in 'Success'
  270. A := IF(StringLib.StringFilterOut('ABCDE', 'BD') = 'ACE',
  271. 'Success',
  272. 'Failure - 1');
  273. B := IF(StringLib.StringFilterOut('ABCDEABCDE', 'BD') = 'ACEACE',
  274. 'Success',
  275. 'Failure - 2');
  276. C := IF(StringLib.StringFilterOut('ABCDEABCDE', '') = 'ABCDEABCDE',
  277. 'Success',
  278. 'Failure - 3');
  279. D := IF(StringLib.StringFilterOut('', 'BD') = '',
  280. 'Success',
  281. 'Failure - 4');
  282. </programlisting>
  283. <para></para>
  284. </sect2>
  285. <sect2 id="Find">
  286. <title><emphasis>Find</emphasis></title>
  287. <para><emphasis role="bold">StringLib.StringFind(</emphasis><emphasis>source, target,
  288. instance</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">StringLib.EbcdicStringFind(</emphasis><emphasis>source,
  289. target, instance</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeFind(</emphasis><emphasis>source,
  290. target, instance</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeLocaleFind(</emphasis><emphasis>source,
  291. target, instance, locale</emphasis><emphasis role="bold">)</emphasis></para>
  292. <para><emphasis>source</emphasis> A string containing the data to
  293. search.</para>
  294. <para><emphasis>target </emphasis>A string containing the substring to
  295. search for.</para>
  296. <para><emphasis>instance </emphasis>An integer specifying which
  297. occurrence of the <emphasis>target</emphasis> to find.</para>
  298. <para><emphasis>locale</emphasis> A null-terminated string containing
  299. the language and country code to use to determine correct sort order
  300. and other operations.</para>
  301. <para>Return:<emphasis> </emphasis>Find returns an INTEGER
  302. value.</para>
  303. <para>The <emphasis role="bold">Find </emphasis>functions return the
  304. beginning index position within the <emphasis>source</emphasis> string
  305. of the specified <emphasis>instance</emphasis> of the <emphasis>target
  306. </emphasis>string. If the <emphasis>target</emphasis> is not found or
  307. the specified <emphasis>instance</emphasis> is greater than the number
  308. of occurrences of the <emphasis>target</emphasis> in the
  309. <emphasis>source</emphasis>, StringFind returns zero (0).</para>
  310. <para>Example:</para>
  311. <programlisting>A := IF(StringLib.StringFind('ABCDE', 'BC',1) = 2,
  312. 'Success',
  313. 'Failure - 1'); //success
  314. B := IF(StringLib.StringFind('ABCDEABCDE', 'BC', 2) = 7,
  315. 'Success',
  316. 'Failure - 2'); //success
  317. C := IF(StringLib.StringFind('ABCDEABCDE', '') = 0,
  318. 'Success',
  319. 'Failure - 3'); //syntax error, missing 3rd parameter
  320. D := IF(StringLib.StringFind('', 'BD', 1) = 0,
  321. 'Success',
  322. 'Failure - 4'); //success
  323. </programlisting>
  324. </sect2>
  325. <sect2 id="StringUnboundedUnsafeFind">
  326. <title><emphasis>StringUnboundedUnsafeFind</emphasis></title>
  327. <para><emphasis role="bold">StringLib.StringUnboundedUnsafeFind(</emphasis><emphasis>source,
  328. target</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">StringLib.EbcdicStringUnboundedUnsafeFind(</emphasis><emphasis>source,
  329. target</emphasis><emphasis role="bold">)</emphasis></para>
  330. <para><emphasis>source</emphasis> A string containing the data to
  331. search.</para>
  332. <para><emphasis>target </emphasis>A string containing the substring to
  333. search for.</para>
  334. <para>Return:<emphasis> </emphasis>Find2 returns an INTEGER
  335. value.</para>
  336. <para>The <emphasis role="bold">StringUnboundedUnsafeFind
  337. </emphasis>functions return the beginning index position within the
  338. <emphasis>source</emphasis> string of the first instance of the
  339. <emphasis>target </emphasis>string. If the <emphasis>target</emphasis>
  340. string is not in the <emphasis>source</emphasis> string (or somewhere
  341. beyond), it creates a runtime exception.</para>
  342. <para><emphasis role="bold">The StringUnboundedUnsafeFind functions
  343. scan the </emphasis><emphasis role="bold">source</emphasis><emphasis role="bold"> string AND BEYOND until it finds what it is looking
  344. for.</emphasis> It is designed for use in variable length string input
  345. routines. Essentially you can pass it a <emphasis>source</emphasis>
  346. that is of length one and it will keep reading beyond the end of the
  347. <emphasis>source</emphasis> to find the <emphasis>target</emphasis>
  348. string and will tell you how far it had to go. Typically, this be used
  349. would search for an end-of-string delimiter to determine how many
  350. bytes of variable-length data there are. This can cause problems if
  351. the <emphasis>target</emphasis> string does not exist.</para>
  352. <para>Example:</para>
  353. <programlisting>A := IF(StringLib.StringUnboundedUnsafeFind('ABCDE', 'BC') = 2,
  354. 'Success',
  355. 'Failure - 1'); //success
  356. B := IF(StringLib.StringFind2('ABCDEABCDE', 'BC') = 7,
  357. 'Success',
  358. 'Failure - 2'); //failure
  359. C := IF(StringLib.StringFind2('ABCDEABCDE', '') = 0,
  360. 'Success',
  361. 'Failure - 3'); //failure
  362. D := IF(StringLib.StringFind2('', 'BD') = 0,
  363. 'Success',
  364. 'Failure - 4'); //runtime exception
  365. </programlisting>
  366. </sect2>
  367. <sect2 id="FindCount">
  368. <title><emphasis>FindCount</emphasis></title>
  369. <para><emphasis role="bold">StringLib.StringFindCount(</emphasis><emphasis>source,
  370. target</emphasis><emphasis role="bold">)</emphasis></para>
  371. <para><emphasis>source</emphasis> A string containing the data to
  372. search.</para>
  373. <para><emphasis>target </emphasis>A string containing the substring to
  374. search for.</para>
  375. <para>Return:<emphasis> </emphasis>StringFindCount returns an INTEGER
  376. value.</para>
  377. <para>The <emphasis role="bold">FindCount </emphasis>function returns
  378. the number of non-overlapping instances of the <emphasis>target
  379. </emphasis>string within the <emphasis>source</emphasis>
  380. string.</para>
  381. <para>Example:</para>
  382. <programlisting>A := IF(StringLib.StringFindCount('ABCDE', 'BC') = 1,
  383. 'Success',
  384. 'Failure - 1'); //success
  385. B := IF(StringLib.StringFindCount('ABCDEABCDE', 'BC') = 2,
  386. 'Success',
  387. 'Failure - 2'); //failure
  388. </programlisting>
  389. </sect2>
  390. <sect2 id="FindAtStrength">
  391. <title><emphasis>FindAtStrength</emphasis></title>
  392. <para><emphasis role="bold">UnicodeLib.UnicodeLocaleFindAtStrength(</emphasis><emphasis>source,target,instance,locale,strength</emphasis><emphasis role="bold">)</emphasis></para>
  393. <para><emphasis>source</emphasis> A string containing the data to
  394. search.</para>
  395. <para><emphasis>target </emphasis>A string containing the substring to
  396. search for.</para>
  397. <para><emphasis>instance </emphasis>An integer specifying which
  398. occurrence of the <emphasis>target</emphasis> to find.</para>
  399. <para><emphasis>locale</emphasis> A null-terminated string containing
  400. the language and country code to use to determine correct sort order
  401. and other operations.</para>
  402. <para><emphasis>strength</emphasis> An integer value indicating how to
  403. compare. Valid values are:</para>
  404. <para>1 ignores accents and case, differentiating only between
  405. letters</para>
  406. <para>2 ignores case but differentiates between accents.</para>
  407. <para>3 differentiates between accents and case but ignores e.g.
  408. differences between Hiragana and Katakana</para>
  409. <para>4 differentiates between accents and case and e.g.
  410. Hiragana/Katakana, but ignores e.g. Hebrew cantellation marks</para>
  411. <para>5 differentiates between all strings whose canonically
  412. decomposed forms (NFD—Normalization Form D) are non-identical</para>
  413. <para>Return:<emphasis> </emphasis>FindAtStrength returns an INTEGER
  414. value.</para>
  415. <para>The <emphasis role="bold">FindAtStrength </emphasis>function
  416. returns the beginning index position within the
  417. <emphasis>source</emphasis> string of the specified
  418. <emphasis>instance</emphasis> of the <emphasis>target
  419. </emphasis>string. If the <emphasis>target</emphasis> is not found or
  420. the specified <emphasis>instance</emphasis> is greater than the number
  421. of occurrences of the <emphasis>target</emphasis> in the
  422. <emphasis>source</emphasis>, StringFind returns zero (0).</para>
  423. <para>Example:</para>
  424. <programlisting>base := u'caf\u00E9'; // U+00E9 is lowercase e with acute
  425. prim := u'coffee shop'; // 1st difference, different letters
  426. seco := u'cafe'; // 2nd difference, accents (no acute)
  427. tert := u'Caf\u00C9'; // 3rd, caps (U+00C9 is u/c E + acute)
  428. search := seco + tert + base;
  429. unicodelib.UnicodeLocaleFindAtStrength(search, base, 1, 'fr', 1) = 1;
  430. // at strength 1, base matches seco (only secondary diffs)
  431. unicodelib.UnicodeLocaleFindAtStrength(search, base, 1, 'fr', 2) = 5;
  432. // at strength 2, base matches tert (only tertiary diffs)
  433. unicodelib.UnicodeLocaleFindAtStrength(search, base, 1, 'fr', 3) = 9;
  434. // at strength 3, base doesn't match either seco or tert
  435. unicodelib.UnicodeLocaleFindAtStrength(u'le caf\u00E9 vert',
  436. u'cafe', 1, 'fr', 2) = 4;
  437. // however, an accent on the source,
  438. unicodelib.UnicodeLocaleFindAtStrength(u'le caf\u00E9 vert',
  439. u'cafe', 1, 'fr', 3) = 4;
  440. // rather than on the pattern,
  441. unicodelib.UnicodeLocaleFindAtStrength(u'le caf\u00E9 vert',
  442. u'cafe', 1, 'fr', 4) = 4;
  443. // is ignored at strengths up to 4,
  444. unicodelib.UnicodeLocaleFindAtStrength(u'le caf\u00E9 vert',
  445. u'cafe', 1, 'fr', 5) = 0;
  446. // and only counts at strength 5
  447. </programlisting>
  448. </sect2>
  449. <sect2 id="FindAtStrengthReplace">
  450. <title><emphasis>FindAtStrengthReplace</emphasis></title>
  451. <para><emphasis role="bold">UnicodeLib.UnicodeLocaleFindAtStrengthReplace(</emphasis><emphasis>source,
  452. target,</emphasis><emphasis> replacement, locale, strength
  453. </emphasis><emphasis role="bold">)</emphasis></para>
  454. <para><emphasis>source</emphasis> A string containing the data to
  455. search.</para>
  456. <para><emphasis>target </emphasis>A string containing the substring to
  457. search for.</para>
  458. <para><emphasis>replacement </emphasis>A string containing the
  459. replacement data.</para>
  460. <para><emphasis>locale</emphasis> A null-terminated string containing
  461. the language and country code to use to determine correct sort order
  462. and other operations.</para>
  463. <para><emphasis>strength</emphasis> An integer value indicating how to
  464. compare. Valid values are:</para>
  465. <para>1 ignores accents and case, differentiating only between
  466. letters.</para>
  467. <para>2 ignores case but differentiates between accents.</para>
  468. <para>3 differentiates between accents and case but ignores e.g.
  469. differences between Hiragana and Katakana</para>
  470. <para>4 differentiates between accents and case and e.g.
  471. Hiragana/Katakana, but ignores e.g. Hebrew cantellation marks</para>
  472. <para>5 differentiates between all strings whose canonically
  473. decomposed forms (NFD—Normalization Form D) are non-identical</para>
  474. <para>Return:<emphasis> </emphasis>FindAtStrengthReplace returns a
  475. UNICODE value.</para>
  476. <para>The <emphasis role="bold">FindAtStrengthReplace
  477. </emphasis>functions return the <emphasis>source</emphasis> string
  478. with the <emphasis>replacement</emphasis> string substituted for all
  479. instances of the <emphasis>target </emphasis>string. If the
  480. <emphasis>target</emphasis> string is not in the
  481. <emphasis>source</emphasis> string, it returns the
  482. <emphasis>source</emphasis> string unaltered.</para>
  483. <para>Example:</para>
  484. <programlisting>unicodelib.UnicodeLocaleFindAtStrengthReplace(u'e\u00E8E\u00C9eE',
  485. u'e\u00E9', u'xyz', 'fr', 1) = u'xyzxyzxyz';
  486. unicodelib.UnicodeLocaleFindAtStrengthReplace(u'e\u00E8E\u00C9eE',
  487. u'e\u00E9', u'xyz', 'fr', 2) = u'e\u00E8xyzeE';
  488. unicodelib.UnicodeLocaleFindAtStrengthReplace(u'e\u00E8E\u00C9eE',
  489. u'e\u00E9', u'xyz', 'fr', 3) = u'e\u00E8E\u00C9eE';
  490. </programlisting>
  491. <para></para>
  492. </sect2>
  493. <sect2 id="FindReplace">
  494. <title><emphasis>FindReplace</emphasis></title>
  495. <para><emphasis role="bold">StringLib.StringFindReplace(</emphasis><emphasis>source,
  496. target, replacement</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeFindReplace(</emphasis><emphasis>source,
  497. target, replacement</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeLocaleFindReplace(</emphasis><emphasis>source,
  498. target, replacement, locale </emphasis><emphasis role="bold">)</emphasis></para>
  499. <para><emphasis>source</emphasis> A string containing the data to
  500. search.</para>
  501. <para><emphasis>target </emphasis>A string containing the substring to
  502. search for.</para>
  503. <para><emphasis>replacement </emphasis>A string containing the
  504. replacement data.</para>
  505. <para><emphasis>locale</emphasis> A null-terminated string containing
  506. the language and country code to use to determine correct sort order
  507. and other operations.</para>
  508. <para>Return:<emphasis> </emphasis>FindReplace returns a STRING or
  509. UNICODE value, as appropriate.</para>
  510. <para>The <emphasis role="bold">FindReplace </emphasis>functions
  511. return the <emphasis>source</emphasis> string with the
  512. <emphasis>replacement</emphasis> string substituted for all instances
  513. of the <emphasis>target </emphasis>string . If the
  514. <emphasis>target</emphasis> string is not in the
  515. <emphasis>source</emphasis> string, it returns the
  516. <emphasis>source</emphasis> string unaltered.</para>
  517. <para>Example:</para>
  518. <programlisting>A := StringLib.StringFindReplace('ABCDEABCDE', 'BC','XY');
  519. //A contains ‘AXYDEAXYDE’
  520. A := unicodelib.UnicodeFindReplace(u'abcde', u'a', u'AAAAA');
  521. //A contains u'AAAAAbcde'
  522. A := unicodelib.UnicodeFindReplace(u'aaaaa', u'aa', u'b');
  523. //A contains u'bba'
  524. A := unicodelib.UnicodeFindReplace(u'aaaaaa', u'aa', u'b');
  525. //A contains u'bbb'
  526. A := unicodelib.UnicodeLocaleFindReplace(u'gh\u0131klm', u'hyk', u'XxXxX', 'lt');
  527. //A contains u'gXxXxXlm'
  528. A := unicodelib.UnicodeLocaleFindReplace(u'gh\u0131klm', u'hyk', u'X', 'lt');
  529. //A contains u'gXlm'
  530. </programlisting>
  531. <para></para>
  532. </sect2>
  533. <sect2 id="StringGetBuildInfo">
  534. <title><emphasis>GetBuildInfo</emphasis></title>
  535. <para><emphasis role="bold">StringLib.GetBuildInfo()</emphasis></para>
  536. <para>Return:<emphasis> </emphasis>GetBuildInfo returns a VARSTRING
  537. (null-terminated) value.</para>
  538. <para>The <emphasis role="bold">GetBuildInfo </emphasis>functions
  539. return a string containing information that specifies the build number
  540. and date/time stamp of the supercomputer software.</para>
  541. <para>Example:</para>
  542. <programlisting>A := StringLib.GetBuildInfo();
  543. </programlisting>
  544. </sect2>
  545. <sect2 id="GetDateYYYYMMDD">
  546. <title><emphasis>GetDateYYYYMMDD</emphasis></title>
  547. <para><emphasis role="bold">StringLib.GetDateYYYYMMDD()</emphasis></para>
  548. <para>Return:<emphasis> </emphasis>GetDateYYYYMMDD returns a STRING
  549. value.</para>
  550. <para>The <emphasis role="bold">GetDateYYYYMMDD </emphasis>function
  551. returns a string containing the current date in YYYYMMDD
  552. format.</para>
  553. <para>Example:</para>
  554. <programlisting>A := GetDateYYYYMMDD();
  555. </programlisting>
  556. </sect2>
  557. <sect2 id="Repad">
  558. <title><emphasis>Repad</emphasis></title>
  559. <para><emphasis role="bold">StringLib.StringRepad(</emphasis><emphasis>source,
  560. size</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeRepad(</emphasis><emphasis>source,
  561. size</emphasis><emphasis role="bold">)</emphasis></para>
  562. <para><emphasis>source</emphasis> A string containing the data to
  563. resize.</para>
  564. <para><emphasis>size </emphasis>A positive integer containing the
  565. number of characters in the result string.</para>
  566. <para>Return:<emphasis> </emphasis>Repad returns a STRING or UNICODE
  567. value, as appropriate.</para>
  568. <para>The <emphasis role="bold">Repad </emphasis>functions return the
  569. <emphasis>source</emphasis> string, stripped of any leading spaces, at
  570. the specified number of characters. Trailing spaces are added as
  571. needed to achieve the required <emphasis>size</emphasis>.</para>
  572. <para>Example:</para>
  573. <programlisting>// All these examples result in 'Success'
  574. A := IF(StringLib.StringRepad('ABCDE ', 6) = 'ABCDE ',
  575. 'Success',
  576. 'Failure - 1');
  577. B := IF(StringLib.StringRepad(' ',6) = ' ',
  578. 'Success',
  579. 'Failure - 2');
  580. C := IF(StringLib.StringRepad('ABCDE ',0)='',
  581. 'Success',
  582. 'Failure - 3');
  583. D := IF(StringLib.StringRepad('ABCDE ', 3) = 'ABC',
  584. 'Success',
  585. 'Failure - 4');
  586. E := IF(StringLib.StringRepad(' ABCDE ', 3) = 'ABC',
  587. 'Success',
  588. 'Failure - 5');
  589. </programlisting>
  590. </sect2>
  591. <sect2 id="Reverse">
  592. <title><emphasis>Reverse</emphasis></title>
  593. <para><emphasis role="bold">StringLib.StringReverse(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeReverse(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis></para>
  594. <para><emphasis>source</emphasis> A string containing the data to
  595. reverse.</para>
  596. <para>Return:<emphasis> </emphasis>Reverse returns a STRING or UNICODE
  597. value, as appropriate.</para>
  598. <para>The <emphasis role="bold">Reverse </emphasis>functions return
  599. the <emphasis>source</emphasis> string with all characters in reverse
  600. order.</para>
  601. <para>Example:</para>
  602. <programlisting>A := StringLib.StringReverse('ABCDE'); //A contains 'EDCBA'
  603. </programlisting>
  604. </sect2>
  605. <sect2 id="String2Data">
  606. <title><emphasis role="bold">String2Data</emphasis></title>
  607. <para><emphasis role="bold">StringLib.String2Data(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis></para>
  608. <para><emphasis>source</emphasis> A STRING to convert.</para>
  609. <para>Return:<emphasis> </emphasis>String2Data returns a DATA
  610. value.</para>
  611. <para>The <emphasis role="bold">String2Data </emphasis>function
  612. returns the DATA value for the hexadecimal characters contained in the
  613. <emphasis>source</emphasis> STRING. This function is the opposite of
  614. the Data2String function.</para>
  615. <para>Example:</para>
  616. <programlisting>DATA2 CrLf := x’0A0D’; //2-bytes of hex
  617. STRING4 CrLfString := StringLib.Data2String(CrLf);
  618. //results in a ‘0A0D’ 4-byte string
  619. DATA2 NewCrLf := StringLib.String2Data(CrLfString);
  620. //and back again
  621. </programlisting>
  622. </sect2>
  623. <sect2 id="Substitute">
  624. <title><emphasis>Substitute</emphasis></title>
  625. <para><emphasis role="bold">StringLib.StringSubstitute(</emphasis><emphasis>source,
  626. target, replacement</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeSubstitute(</emphasis><emphasis>source,
  627. target, replacement</emphasis><emphasis role="bold">)</emphasis></para>
  628. <para><emphasis>source</emphasis> A string containing the data to
  629. search.</para>
  630. <para><emphasis>target </emphasis>A string containing the substring to
  631. search for.</para>
  632. <para><emphasis>replacement </emphasis>A string containing the
  633. replacement character.</para>
  634. <para>Return:<emphasis> </emphasis>Substitute returns a STRING or
  635. UNICODE value, as appropriate.</para>
  636. <para>The <emphasis role="bold">Substitute </emphasis>functions return
  637. the <emphasis>source</emphasis> string with the
  638. <emphasis>replacement</emphasis> character substituted for all
  639. characters except those in the <emphasis>target </emphasis>string. If
  640. the <emphasis>target</emphasis> string is not in the
  641. <emphasis>source</emphasis> string, it returns the
  642. <emphasis>source</emphasis> string with all characters replaced by the
  643. <emphasis>replacement</emphasis> character.</para>
  644. <para>Example:</para>
  645. <programlisting>A := unicodelib.UnicodeSubstitute(u'abcdeabcdec', u'cd', u'x');
  646. //A contains u'xxcdxxxcdxc';
  647. </programlisting>
  648. </sect2>
  649. <sect2 id="SubstituteOut">
  650. <title><emphasis>SubstituteOut</emphasis></title>
  651. <para><emphasis role="bold">StringLib.StringSubstituteOut(</emphasis><emphasis>source,
  652. target, replacement</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeSubstituteOut(</emphasis><emphasis>source,
  653. target, replacement</emphasis><emphasis role="bold">)</emphasis></para>
  654. <para><emphasis>source</emphasis> A string containing the data to
  655. search.</para>
  656. <para><emphasis>target </emphasis>A string containing the substring to
  657. search for.</para>
  658. <para><emphasis>replacement </emphasis>A string containing the
  659. replacement character.</para>
  660. <para>Return:<emphasis> </emphasis>Substitute returns a STRING or
  661. UNICODE value, as appropriate.</para>
  662. <para>The <emphasis role="bold">Substitute </emphasis>functions return
  663. the <emphasis>source</emphasis> string with the
  664. <emphasis>replacement</emphasis> character substituted for all
  665. characters that exist in both the <emphasis>source</emphasis> and the
  666. <emphasis>target </emphasis>string. If no <emphasis>target</emphasis>
  667. string characters are in the <emphasis>source</emphasis> string, it
  668. returns the <emphasis>source</emphasis> string unaltered.</para>
  669. <para>Example:</para>
  670. <programlisting>A := unicodelib.UnicodeSubstituteOut(u'abcde', u'cd', u'x');
  671. //A contains u'abxxe';
  672. </programlisting>
  673. </sect2>
  674. <sect2 id="ToLowerCase">
  675. <title><emphasis>ToLowerCase</emphasis></title>
  676. <para><emphasis role="bold">StringLib.StringToLowerCase(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeToLowerCase(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeLocaleToLowerCase(</emphasis><emphasis>
  677. source, locale </emphasis><emphasis role="bold">)</emphasis></para>
  678. <para><emphasis>source</emphasis> A string containing the data to
  679. change case.</para>
  680. <para><emphasis>locale</emphasis> A null-terminated string containing
  681. the language and country code to use to determine correct sort order
  682. and other operations.</para>
  683. <para>Return:<emphasis> </emphasis>ToLowerCase returns a STRING or
  684. UNICODE value, as appropriate.</para>
  685. <para>The <emphasis role="bold">ToLowerCase </emphasis>functions
  686. return the <emphasis>source</emphasis> string with all upper case
  687. characters converted to lower case.</para>
  688. <para>Example:</para>
  689. <programlisting>A := StringLib.StringToLowerCase('ABCDE'); //A contains ‘abcde’
  690. </programlisting>
  691. </sect2>
  692. <sect2 id="ToProperCase">
  693. <title><emphasis>ToProperCase</emphasis></title>
  694. <para><emphasis role="bold">StringLib.StringToProperCase(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeToProperCase(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeLocaleToProperCase(</emphasis><emphasis>
  695. source, locale </emphasis><emphasis role="bold">)</emphasis></para>
  696. <para><emphasis>source</emphasis> A string containing the data to
  697. change case.</para>
  698. <para><emphasis>locale</emphasis> A null-terminated string containing
  699. the language and country code to use to determine correct sort order
  700. and other operations.</para>
  701. <para>Return:<emphasis> </emphasis>ToProperCase returns a STRING or
  702. UNICODE value, as appropriate.</para>
  703. <para>The <emphasis role="bold">ToProperCase </emphasis>functions
  704. return the <emphasis>source</emphasis> string with the first letter of
  705. each word in upper case and all other letters left as-is.</para>
  706. <para>Example:</para>
  707. <programlisting>A := StringLib.StringToProperCase('ABCDE ABCDE ');
  708. //A contains ‘Abcde Abcde’
  709. </programlisting>
  710. <para></para>
  711. </sect2>
  712. <sect2 id="ToUpperCase">
  713. <title><emphasis>ToUpperCase</emphasis></title>
  714. <para><emphasis role="bold">StringLib.StringToUpperCase(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeToUpperCase(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeLocaleToUpperCase(</emphasis><emphasis>
  715. source, locale </emphasis><emphasis role="bold">)</emphasis></para>
  716. <para><emphasis>source</emphasis> A string containing the data to
  717. change case.</para>
  718. <para><emphasis>locale</emphasis> A null-terminated string containing
  719. the language and country code to use to determine correct sort order
  720. and other operations.</para>
  721. <para>Return:<emphasis> </emphasis>StringToUpperCase returns a STRING
  722. value.</para>
  723. <para>The <emphasis role="bold">ToUpperCase </emphasis>functions
  724. return the <emphasis>source</emphasis> string with all lower case
  725. characters converted to upper case.</para>
  726. <para>Example:</para>
  727. <programlisting>A := StringLib.StringToUpperCase('abcde');
  728. //A contains ‘ABCDE’
  729. </programlisting>
  730. </sect2>
  731. <sect2 id="WildMatch">
  732. <title><emphasis>WildMatch</emphasis></title>
  733. <para><emphasis role="bold">StringLib.StringWildMatch(</emphasis><emphasis>source,
  734. pattern, nocase</emphasis><emphasis role="bold">)</emphasis><emphasis role="bold">UnicodeLib.UnicodeWildMatch(</emphasis><emphasis>source,
  735. pattern, nocase</emphasis><emphasis role="bold">)</emphasis></para>
  736. <para><emphasis>source</emphasis> A string containing the data to
  737. search.</para>
  738. <para><emphasis>pattern </emphasis>A string containing the wildcard
  739. expression to match. Valid wildcards are ? (single character) and *
  740. (multiple character).</para>
  741. <para><emphasis>nocase</emphasis> A boolean true or false indicating
  742. whether to ignore the case.</para>
  743. <para>Return:<emphasis> </emphasis>WildMatch returns a BOOLEAN
  744. value.</para>
  745. <para>The <emphasis role="bold">WildMatch </emphasis>function returns
  746. TRUE if the <emphasis>pattern</emphasis> matches the
  747. <emphasis>source</emphasis>.</para>
  748. <para>The case-insensitive version of UnicodeWildMatch has been
  749. optimized for speed over accuracy. For accurate case-folding, you
  750. should either use the UnicodeToUpperCase function explicity and then a
  751. case-sensitive UnicodeWildMatch, or use REGEXFIND.</para>
  752. <para>Example:</para>
  753. <programlisting>stringlib.stringwildmatch('abcdeabcdec', 'a?c*', false) = TRUE;
  754. </programlisting>
  755. <para></para>
  756. </sect2>
  757. </sect1>
  758. <sect1 id="Data_Handling">
  759. <title><emphasis>Data Handling</emphasis></title>
  760. <sect2 id="AddressClean">
  761. <title><emphasis role="bold">AddressClean</emphasis></title>
  762. <para><emphasis role="bold">DataLib.AddressClean(</emphasis><emphasis>source1,source2</emphasis><emphasis role="bold">)</emphasis></para>
  763. <para><emphasis>source1</emphasis> A string containing the street
  764. address line to clean.</para>
  765. <para><emphasis>source2</emphasis> A string containing the
  766. city/state/zip address line to clean.</para>
  767. <para>Return:<emphasis> </emphasis>AddressClean returns a STRING
  768. value.</para>
  769. <para>The <emphasis role="bold">AddressClean </emphasis>function
  770. returns a 261-byte string in the following format:</para>
  771. <para><emphasis role="bold">Byte Position Component</emphasis></para>
  772. <para>1 primary address number</para>
  773. <para>11 predirectional (N,NE,E,SE,S,SW,W,NW)</para>
  774. <para>13 street name</para>
  775. <para>41 suffix (ST, AVE, BLVD, etc.)</para>
  776. <para>45 postdirectional (N,NE,E,SE,S,SW,W,NW)</para>
  777. <para>47 secondary address indentifier (APT, STE, etc.)</para>
  778. <para>57 secondary address range</para>
  779. <para>65 city</para>
  780. <para>90 state</para>
  781. <para>92 5-digit zipcode</para>
  782. <para>97 zip plus4</para>
  783. <para>101 country</para>
  784. <para>141 confidence level (0-9, 0=good 9=bad)</para>
  785. <para>142 person (if source1 contains a name also)</para>
  786. <para>Example:</para>
  787. <programlisting>A := DataLib.AddressClean('4590 NW 23rd Boulevard South Suite 307','Boca Raton, Fl 33434-6332');
  788. /* A contains ‘4590 NW23RD BLVDS STE 307 BOCA RATON FL 33434 6332 1’ */
  789. </programlisting>
  790. <para></para>
  791. </sect2>
  792. <sect2 id="CompanyClean">
  793. <title><emphasis role="bold">CompanyClean</emphasis></title>
  794. <para><emphasis role="bold">DataLib.CompanyClean(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis></para>
  795. <para><emphasis>source</emphasis> A string containing the company
  796. name.</para>
  797. <para>Return:<emphasis> </emphasis>CompanyClean returns a STRING
  798. value.</para>
  799. <para>The <emphasis role="bold">CompanyClean </emphasis>function
  800. returns a 120-byte string in the following format:</para>
  801. <para><emphasis role="bold">Byte Position Component</emphasis></para>
  802. <para>1 cleaned primary part of company name</para>
  803. <para>41 cleaned secondary part of company name</para>
  804. <para>81 “discardable” words (such as Corp. Inc. Ltd.)</para>
  805. <para>Example:</para>
  806. <programlisting>A := DataLib.CompanyClean('The Seisint Data Mgmnt Company, Inc. Ltd');
  807. /* A contains ‘THE SEISINT DATA MGMNT COMPANY INC LTD’ */
  808. </programlisting>
  809. </sect2>
  810. <sect2 id="DeDouble">
  811. <title><emphasis role="bold">DeDouble</emphasis></title>
  812. <para><emphasis role="bold">DataLib.DeDouble(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis></para>
  813. <para><emphasis>source</emphasis> A string to process.</para>
  814. <para>Return:<emphasis> </emphasis>DeDouble returns a STRING
  815. value.</para>
  816. <para>The <emphasis role="bold">DeDouble </emphasis>function returns
  817. the <emphasis>source</emphasis> string with all instances of multiple
  818. adjacent characters (2 or more like characters together) reduced to a
  819. single instance.</para>
  820. <para>Example:</para>
  821. <programlisting>A := DataLib.DeDouble('ABBBCCDE'); //A contains 'ABCDE'
  822. </programlisting>
  823. </sect2>
  824. <sect2 id="Gender">
  825. <title><emphasis role="bold">Gender</emphasis></title>
  826. <para><emphasis role="bold">DataLib.Gender(</emphasis><emphasis>name</emphasis><emphasis role="bold">)</emphasis></para>
  827. <para><emphasis>name</emphasis> A string containing the forename to
  828. process.</para>
  829. <para>Return:<emphasis> </emphasis>Gender returns a STRING1 value,
  830. .</para>
  831. <para>The <emphasis role="bold">Gender </emphasis>function returns the
  832. gender most commonly associated with the <emphasis>name</emphasis>
  833. string as M (male), F (female), N (neutral), or U (unkown).</para>
  834. <para>Example:</para>
  835. <programlisting>A := DataLib.Gender('DAVID'); //A contains 'M'
  836. B := DataLib.Gender('LESLIE'); //B contains 'N'
  837. C := DataLib.Gender('SUSAN'); //C contains 'F'
  838. D := DataLib.Gender('ABCDE'); //D contains 'U'
  839. </programlisting>
  840. </sect2>
  841. <sect2 id="LeadMatch">
  842. <title><emphasis role="bold">LeadMatch</emphasis></title>
  843. <para><emphasis role="bold">DataLib.LeadMatch(</emphasis><emphasis>source1,source2</emphasis><emphasis role="bold">)</emphasis></para>
  844. <para><emphasis>source1</emphasis> A string to compare.</para>
  845. <para><emphasis>source2</emphasis> A string to compare.</para>
  846. <para>Return:<emphasis> </emphasis>LeadMatch returns an UNSIGNED
  847. INTEGER value.</para>
  848. <para>The <emphasis role="bold">LeadMatch </emphasis>function returns
  849. the number of matching characters at the beginning of the
  850. <emphasis>source1</emphasis> and <emphasis>source2</emphasis>
  851. strings.</para>
  852. <para>Example:</para>
  853. <programlisting>A := DataLib.LeadMatch('ABCDE','ABXDE'); //A contains 2
  854. </programlisting>
  855. </sect2>
  856. <sect2 id="NameClean">
  857. <title><emphasis role="bold">NameClean</emphasis></title>
  858. <para><emphasis role="bold">DataLib.NameClean(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis></para>
  859. <para><emphasis>source</emphasis> A string containing the name.</para>
  860. <para>Return:<emphasis> </emphasis>NameClean returns a STRING
  861. value.</para>
  862. <para>The <emphasis role="bold">NameClean </emphasis>function returns
  863. a 142-byte string in the following format:</para>
  864. <para><emphasis role="bold">Byte Position Component</emphasis></para>
  865. <para>1 first name</para>
  866. <para>41 middle name</para>
  867. <para>81 last name</para>
  868. <para>121 name prefix (MR, MRS, DR, etc.)</para>
  869. <para>131 name suffix (JR, SR, III, etc.)</para>
  870. <para>141 gender code (M, F, N)</para>
  871. <para>142 confidence flag (0-9, 0=good 9=bad)</para>
  872. <para>Example:</para>
  873. <programlisting>A := DataLib.NameClean('Betty Ann Boop');
  874. /*A contains ‘BETTY ANN BOOP F0’ */
  875. B := DataLib.NameClean('Leslie Jean Boop');
  876. /*B contains ‘LESLIE JEAN BOOP N0’ */
  877. </programlisting>
  878. </sect2>
  879. <sect2 id="NameMatch">
  880. <title><emphasis role="bold">NameMatch</emphasis></title>
  881. <para><emphasis role="bold">DataLib.NameMatch(</emphasis><emphasis>leftfirst,leftmiddle,leftlast,rightfirst,rightmiddle,rightlast</emphasis><emphasis role="bold">)</emphasis></para>
  882. <para><emphasis>leftfirst</emphasis> A string containing the first
  883. name.</para>
  884. <para><emphasis>leftmiddle</emphasis> A string containing the middle
  885. name.</para>
  886. <para><emphasis>leftlast</emphasis> A string containing the last
  887. name.</para>
  888. <para><emphasis>rightfirst</emphasis> A string containing the first
  889. name.</para>
  890. <para><emphasis>rightmiddle</emphasis> A string containing the middle
  891. name.</para>
  892. <para><emphasis>rightlast</emphasis> A string containing the last
  893. name.</para>
  894. <para>Return:<emphasis> </emphasis>NameMatch returns an UNSIGNED
  895. INTEGER4 value.</para>
  896. <para>The <emphasis role="bold">NameMatch </emphasis>function returns
  897. a score indicating how closely the <emphasis>leftfirst, leftmiddle,
  898. </emphasis>and <emphasis>leftlast </emphasis>name matches the
  899. <emphasis>rightfirst, rightmiddle, </emphasis>and <emphasis>rightlast
  900. </emphasis>name. The lower the score, the closer the match, with zero
  901. (0) indicating a perfect match.</para>
  902. <para>This function compares the probability of the two incoming names
  903. referring to the same person versus one of the names referring to
  904. somebody else (this is not quite the same as them not being a
  905. reference to the same person). The main distinction is in the area of
  906. noise. Noise is defined as: a name (first or middle) that is not in
  907. our tables (we have more than 100K in our tables), or a last name we
  908. have never encountered with repeating characters or too few vowels,
  909. etc. Noise causes that portion of the name to be underwieghted in the
  910. final scoring.</para>
  911. <para>Example:</para>
  912. <programlisting>A1 := DataLib.NameMatch('RICHARD', 'L', 'TAYLOR',
  913. 'RICHARD', 'L', 'TAYLOR'); //returns 0
  914. A2 := DataLib.NameMatch('RICH', 'L', 'TAYLOR',
  915. 'RICHARD', 'L', 'TAYLOR'); //returns 1
  916. A3 := DataLib.NameMatch('RICH', '', 'TAYLOR',
  917. 'RICHARD', 'L', 'TAYLOR'); //returns 2
  918. A4 := DataLib.NameMatch('ROD', 'L', 'TAYLOR',
  919. 'RICHARD', 'L', 'TAYLOR'); //returns 99
  920. //this gets a high score because there is a high chance
  921. // of ROD being a valid name of somebody else
  922. A5 := DataLib.NameMatch('ZXCVBNM', 'L', 'T',
  923. 'RICHARD', 'L', 'TAYLORSKY'); //returns 100
  924. A6 := DataLib.NameMatch('ZXCVBNM', 'B', 'T',
  925. 'RICHARD', 'L', 'TAYLOR'); //returns 199
  926. A7 := DataLib.NameMatch('T', 'L', 'ZXCVBNM',
  927. 'TAYLOR', 'L', 'RICHARD'); //returns 100
  928. </programlisting>
  929. </sect2>
  930. <sect2 id="NameSimilar">
  931. <title><emphasis role="bold">NameSimilar</emphasis></title>
  932. <para><emphasis role="bold">DataLib.NameSimilar(</emphasis><emphasis>left,right,
  933. blanks</emphasis><emphasis role="bold">)</emphasis></para>
  934. <para><emphasis>left</emphasis> A string containing the name.</para>
  935. <para><emphasis>right</emphasis> A string containing the name.</para>
  936. <para><emphasis>blanks</emphasis> A boolean value. When TRUE, it
  937. strips trailing spaces for the comparison between
  938. <emphasis>left</emphasis> and <emphasis>right</emphasis>.</para>
  939. <para>Return:<emphasis> </emphasis>NameSimilar returns an UNSIGNED
  940. INTEGER4 value.</para>
  941. <para>The <emphasis role="bold">NameSimilar </emphasis>function
  942. returns a score indicating how closely the <emphasis>left
  943. </emphasis>name matches the <emphasis>right </emphasis>name. The lower
  944. the score, the closer the match, with zero (0) indicating a perfect
  945. match.</para>
  946. <para>Example:</para>
  947. <programlisting>A1 := datalib.NameSimilar('Fred Smith','Fred Smith',1); // returns 0
  948. A2 := datalib.NameSimilar('Fred Smith','Fred Smythe',1); // returns 1
  949. A3 := datalib.NameSimilar('Fred Smith','Fred Jones',1); // returns 99
  950. </programlisting>
  951. </sect2>
  952. <sect2 id="PositionalMatch">
  953. <title><emphasis role="bold">PositionalMatch</emphasis></title>
  954. <para><emphasis role="bold">DataLib.PositionalMatch(</emphasis><emphasis>source1,source2</emphasis><emphasis role="bold">)</emphasis></para>
  955. <para><emphasis>source1</emphasis> A string to compare.</para>
  956. <para><emphasis>source2</emphasis> A string to compare.</para>
  957. <para>Return:<emphasis> </emphasis>PositionalMatch returns an UNSIGNED
  958. INTEGER value.</para>
  959. <para>The <emphasis role="bold">PositionalMatch </emphasis>function
  960. returns the number of matching characters at the exactly the same
  961. positions within the <emphasis>source1</emphasis> and
  962. <emphasis>source2</emphasis> strings.</para>
  963. <para>Example:</para>
  964. <programlisting>A := DataLib.PositionalMatch(‘ABCDE’,’ABXDE’); //A contains 4
  965. B := DataLib.PositionalMatch(‘ABCDE’,’ABCDE’); //B contains 5
  966. C := DataLib.PositionalMatch(‘ABCDE’,’EABCDE’); //C contains 0
  967. </programlisting>
  968. </sect2>
  969. <sect2 id="PreferredFirst">
  970. <title><emphasis role="bold">PreferredFirst</emphasis></title>
  971. <para><emphasis role="bold">DataLib.PreferredFirst(</emphasis><emphasis>source</emphasis><emphasis role="bold">)</emphasis></para>
  972. <para><emphasis>source</emphasis> A string containing the first
  973. name.</para>
  974. <para>Return:<emphasis> </emphasis>PreferredFirst returns a STRING
  975. value.</para>
  976. <para>The <emphasis role="bold">PreferredFirst </emphasis>function
  977. returns the preferred first name replacement for the <emphasis>source
  978. </emphasis>first name given. This is used to replace nicknames with
  979. their more formal equivalents.</para>
  980. <para>Example:</para>
  981. <programlisting>A := DataLib.PreferredFirst('Dick'); //A contains ‘RICHARD’
  982. B := DataLib.PreferredFirst('RICHIE'); //B contains ‘RICHARD’
  983. C := DataLib.PreferredFirst('GWEN'); //C contains ‘GWENDOLYN’
  984. </programlisting>
  985. </sect2>
  986. <sect2 id="SlidingMatch">
  987. <title><emphasis role="bold">SlidingMatch</emphasis></title>
  988. <para><emphasis role="bold">DataLib.SlidingMatch(</emphasis><emphasis>source1,source2</emphasis><emphasis role="bold">)</emphasis></para>
  989. <para><emphasis>source1</emphasis> A string to compare.</para>
  990. <para><emphasis>source2</emphasis> A string to compare.</para>
  991. <para>Return:<emphasis> </emphasis>SlidingMatch returns an UNSIGNED
  992. INTEGER value.</para>
  993. <para>The <emphasis role="bold">SlidingMatch </emphasis>function
  994. returns the number of characters in <emphasis>source2</emphasis> which
  995. appear in exactly the same sequence within the
  996. <emphasis>source1</emphasis> string. There is a penalty imposed if
  997. subsequent slides happen without at least two matches in
  998. between.</para>
  999. <para>Example:</para>
  1000. <programlisting>A := DataLib.SlidingMatch('CBABT','CAT'); //A contains 2 (penalty)
  1001. B := DataLib.SlidingMatch('CABT','CAT'); //B contains 3 (no penalty)
  1002. C := DataLib.SlidingMatch('CBAT','CAT'); //C contains 3 (no penalty)
  1003. D := DataLib.SlidingMatch('CAT','CAT'); //D contains 3
  1004. </programlisting>
  1005. </sect2>
  1006. <sect2 id="StrCompare">
  1007. <title><emphasis role="bold">StrCompare</emphasis></title>
  1008. <para><emphasis role="bold">DataLib.StrCompare(</emphasis><emphasis>source1,
  1009. source2</emphasis><emphasis role="bold">)</emphasis></para>
  1010. <para><emphasis>source1</emphasis> A string to compare.</para>
  1011. <para><emphasis>source2</emphasis> A string to compare.</para>
  1012. <para>Return:<emphasis> </emphasis>StrCompare returns an INTEGER
  1013. value.</para>
  1014. <para>The <emphasis role="bold">StrCompare </emphasis>function returns
  1015. a score from 0 to 100 that indicates how closely the
  1016. <emphasis>source1</emphasis> and <emphasis>source2</emphasis> strings
  1017. match.</para>
  1018. <para>Example:</para>
  1019. <programlisting>A := DataLib.StrCompare('ABCDEABCDE','ABCDEABCDE'); //A contains 100
  1020. B := DataLib.StrCompare('ABCDEABCDE','ABCDE ABCDE'); //B contains 95
  1021. C := DataLib.StrCompare('ABCDEABCDE','WXYZ ABCDE'); //C contains 50
  1022. D := DataLib.StrCompare('ABCDEABCDE','WXYZ WXYZ'); //D contains 0
  1023. </programlisting>
  1024. </sect2>
  1025. <sect2 id="StringFind">
  1026. <title><emphasis role="bold">StringFind</emphasis></title>
  1027. <para><emphasis role="bold">DataLib.StringFind(</emphasis><emphasis>source, target,
  1028. instance</emphasis><emphasis role="bold">)</emphasis></para>
  1029. <para><emphasis>source</emphasis> A string containing the data to
  1030. search.</para>
  1031. <para><emphasis>target </emphasis>A string containing the substring to
  1032. search for.</para>
  1033. <para><emphasis>instance </emphasis>An integer specifying which
  1034. occurrence of the substring to find.</para>
  1035. <para>Return:<emphasis> </emphasis>StringFind returns an INTEGER
  1036. value.</para>
  1037. <para>The <emphasis role="bold">StringFind </emphasis>function returns
  1038. the beginning index position within the <emphasis>source</emphasis>
  1039. string of the specified <emphasis>instance</emphasis> of the
  1040. <emphasis>target </emphasis>string. If the <emphasis>target</emphasis>
  1041. is not found or the specified <emphasis>instance</emphasis> is greater
  1042. than the number of occurrences of the <emphasis>target</emphasis> in
  1043. the <emphasis>source</emphasis>, StringFind returns zero (0).</para>
  1044. <para>Example:</para>
  1045. <programlisting>A := IF(DataLib.StringFind('ABCDE', 'BC',1) = 2,
  1046. 'Success',
  1047. 'Failure - 1'); //success
  1048. B := IF(DataLib.StringFind('ABCDEABCDE', 'BC', 2) = 7,
  1049. 'Success',
  1050. 'Failure - 2'); //success
  1051. C := IF(DataLib.StringFind('ABCDEABCDE', '') = 0,
  1052. 'Success',
  1053. 'Failure - 3'); //syntax error
  1054. D := IF(DataLib.StringFind('', 'BD', 1) = 0,
  1055. 'Success',
  1056. 'Failure - 4'); //success
  1057. </programlisting>
  1058. </sect2>
  1059. <sect2 id="StringReplaceSmaller">
  1060. <title><emphasis role="bold">StringReplaceSmaller</emphasis></title>
  1061. <para><emphasis role="bold">DataLib.StringReplaceSmaller(</emphasis><emphasis>source,
  1062. target, replacement</emphasis><emphasis role="bold">)</emphasis></para>
  1063. <para><emphasis>source</emphasis> A string containing the data to
  1064. search.</para>
  1065. <para><emphasis>target </emphasis>A string containing the substring to
  1066. search for.</para>
  1067. <para><emphasis>replacement </emphasis>A string containing the
  1068. replacement data.</para>
  1069. <para>Return:<emphasis> </emphasis>StringReplaceSmaller returns a
  1070. STRING value.</para>
  1071. <para>The <emphasis role="bold">StringReplaceSmaller
  1072. </emphasis>function returns the <emphasis>source</emphasis> string
  1073. with the <emphasis>replacement</emphasis> string substituted for all
  1074. instances of the <emphasis>target </emphasis>string, but only if the
  1075. length of the <emphasis>replacement</emphasis> string is &lt;= the
  1076. length of the <emphasis>target</emphasis> string . If the
  1077. <emphasis>target</emphasis> string is not in the
  1078. <emphasis>source</emphasis> string or the
  1079. <emphasis>replacement</emphasis> is too long, it returns the
  1080. <emphasis>source</emphasis> string unaltered.</para>
  1081. <para>Example:</para>
  1082. <programlisting>A := DataLib.StringReplaceSmaller('ABCDEABCDE', 'BC','XY');
  1083. //A contains ‘AXYDEAXYDE’
  1084. </programlisting>
  1085. </sect2>
  1086. <sect2 id="StringSimilar100">
  1087. <title><emphasis role="bold">StringSimilar100</emphasis></title>
  1088. <para><emphasis role="bold">DataLib.StringSimilar100(</emphasis><emphasis>left,right</emphasis><emphasis role="bold">)</emphasis></para>
  1089. <para><emphasis>left</emphasis> A string.</para>
  1090. <para><emphasis>right</emphasis> A string.</para>
  1091. <para>Return:<emphasis> </emphasis>StringSimilar100 returns an
  1092. UNSIGNED INTEGER4 value.</para>
  1093. <para>The <emphasis role="bold">StringSimilar </emphasis>function
  1094. returns a score indicating how closely the <emphasis>left
  1095. </emphasis>string matches the <emphasis>right </emphasis>string. The
  1096. lower the score, the closer the match, with zero (0) indicating a
  1097. perfect match.</para>
  1098. <para>Example:</para>
  1099. <programlisting>A1 := datalib.stringsimilar100('abc','abc'); //returns 0
  1100. A2 := datalib.stringsimilar100('abc','cde'); //returns 67
  1101. A3 := datalib.stringsimilar100('abc','abcde'); //returns 27
  1102. A4 := datalib.stringsimilar100('abc','ABC'); //returns 100
  1103. A5 := datalib.stringsimilar100('abc','xyz'); //returns 100
  1104. </programlisting>
  1105. </sect2>
  1106. </sect1>
  1107. <sect1 id="File_Handling">
  1108. <title><emphasis>File Handling</emphasis></title>
  1109. <sect2 id="CompareFiles">
  1110. <title><emphasis role="bold">CompareFiles</emphasis></title>
  1111. <para><emphasis role="bold">FileServices.CompareFiles(</emphasis><emphasis> file1,
  1112. file2 </emphasis><emphasis role="bold">[</emphasis><emphasis>,
  1113. logicalonly </emphasis><emphasis role="bold">]</emphasis><emphasis>
  1114. </emphasis><emphasis role="bold">[</emphasis><emphasis>, usecrcs
  1115. </emphasis><emphasis role="bold">]</emphasis><emphasis>
  1116. </emphasis><emphasis role="bold">)</emphasis></para>
  1117. <para><emphasis>file1</emphasis> A null-terminated string containing
  1118. the logical name of the first file.</para>
  1119. <para><emphasis>file2</emphasis> A null-terminated string containing
  1120. the logical name of the second file.</para>
  1121. <para><emphasis>logicalonly</emphasis> Optional. A boolean TRUE/FALSE
  1122. flag that, when TRUE, does not compare physical information from disk
  1123. but only the logical information in the system datastore (Dali). If
  1124. omitted, the default is TRUE.</para>
  1125. <para><emphasis>usecrcs</emphasis> Optional. A boolean TRUE/FALSE flag
  1126. indicating that, when TRUE, compares physical CRCs of all the parts on
  1127. disk. This may be slow on large files. If omitted, the default is
  1128. FALSE.</para>
  1129. <para>Return:<emphasis> </emphasis>CompareFiles returns returns an
  1130. INTEGER4 value.</para>
  1131. <para>The <emphasis role="bold">CompareFiles </emphasis>function
  1132. compares <emphasis>file1</emphasis> against <emphasis>file2</emphasis>
  1133. and returns the following values:</para>
  1134. <para>0 <emphasis>file1</emphasis> and <emphasis>file2</emphasis>
  1135. match exactly 1 <emphasis>file1</emphasis> and
  1136. <emphasis>file2</emphasis> contents match, but
  1137. <emphasis>file1</emphasis> is newer than <emphasis>file2</emphasis> -1
  1138. <emphasis>file1</emphasis> and <emphasis>file2</emphasis> contents
  1139. match, but <emphasis>file2</emphasis> is newer than
  1140. <emphasis>file1</emphasis> 2 <emphasis>file1</emphasis> and
  1141. <emphasis>file2</emphasis> contents do not match and
  1142. <emphasis>file1</emphasis> is newer than <emphasis>file2</emphasis> -2
  1143. <emphasis>file1</emphasis> and <emphasis>file2</emphasis> contents do
  1144. not match and <emphasis>file2</emphasis> is newer than
  1145. <emphasis>file1</emphasis></para>
  1146. <para>Example:</para>
  1147. <programlisting>A := FileServices.CompareFiles('Fred1', 'Fred2');
  1148. </programlisting>
  1149. </sect2>
  1150. <sect2 id="DeleteLogicalFile">
  1151. <title><emphasis role="bold">DeleteLogicalFile</emphasis></title>
  1152. <para><emphasis role="bold">FileServices.DeleteLogicalFile(</emphasis><emphasis>
  1153. filename </emphasis><emphasis role="bold">[</emphasis><emphasis>,
  1154. ifexists </emphasis><emphasis role="bold">] )</emphasis></para>
  1155. <para><emphasis>filename</emphasis> A null-terminated string
  1156. containing the logical name of the file.</para>
  1157. <para><emphasis>ifexists</emphasis> Optional. A boolean value
  1158. indicating whether to post an error if the
  1159. <emphasis>filename</emphasis> does not exist. If omitted, the default
  1160. is FALSE.</para>
  1161. <para>The <emphasis role="bold">DeleteLogicalFile </emphasis>function
  1162. removes the named file from disk.</para>
  1163. <para>Example:</para>
  1164. <programlisting>A := FileServices.DeleteLogicalFile('Fred');
  1165. </programlisting>
  1166. </sect2>
  1167. <sect2 id="LogicalFileList">
  1168. <title><emphasis role="bold">LogicalFileList</emphasis></title>
  1169. <para><emphasis role="bold">FileServices.LogicalFileList(</emphasis><emphasis>
  1170. </emphasis><emphasis role="bold">[ </emphasis><emphasis>pattern
  1171. </emphasis><emphasis role="bold">] [,
  1172. </emphasis><emphasis>includenormal</emphasis><emphasis role="bold"> ]
  1173. [, </emphasis><emphasis>includesuper</emphasis><emphasis role="bold">
  1174. ]</emphasis><emphasis role="bold"> [,
  1175. </emphasis><emphasis>unknownszero </emphasis><emphasis role="bold">]
  1176. )</emphasis></para>
  1177. <para><emphasis>pattern</emphasis> Optional. A null-terminated string
  1178. containing the mask of the files to list. If omitted,the default is
  1179. '*' (all files).</para>
  1180. <para><emphasis>includenormal</emphasis> Optional. A boolean flag
  1181. indicating whether to include “normal” files. If omitted, the default
  1182. is TRUE.</para>
  1183. <para><emphasis>includesuper</emphasis> Optional. A boolean flag
  1184. indicating whether to include SuperFiles. If omitted, the default is
  1185. FALSE.</para>
  1186. <para><emphasis>unknownszero</emphasis> Optional. A boolean flag
  1187. indicating to set file sizes that are unknown to zero (0) instead of
  1188. minus-one (-1). If omitted, the default is FALSE.</para>
  1189. <para>Return:<emphasis> </emphasis>LogicalFileList returns returns a
  1190. dataset in the following format:</para>
  1191. <para><programlisting>EXPORT FsLogicalFileNameRecord := RECORD</programlisting></para>
  1192. <para><programlisting>STRING name;</programlisting></para>
  1193. <para><programlisting>END;</programlisting></para>
  1194. <para><programlisting>EXPORT FsLogicalFileInfoRecord :=</programlisting></para>
  1195. <programlisting>RECORD(FsLogicalFileNameRecord)</programlisting>
  1196. <programlisting>BOOLEAN superfile;</programlisting>
  1197. <programlisting>UNSIGNED8 size;</programlisting>
  1198. <programlisting>UNSIGNED8 rowcount;</programlisting>
  1199. <programlisting>STRING19 modified;</programlisting>
  1200. <programlisting>STRING owner;</programlisting>
  1201. <programlisting>STRING cluster;</programlisting>
  1202. <programlisting>END;</programlisting>
  1203. <para>The <emphasis role="bold">LogicalFileList </emphasis>function
  1204. returns a list of the logical files in the environment files as a
  1205. dataset in the format listed above.</para>
  1206. <para>Example:</para>
  1207. <programlisting>OUTPUT(FileServices.LogicalFileList());
  1208. //returns all normal files
  1209. OUTPUT(FileServices.LogicalFileList(,FALSE,TRUE));
  1210. //returns all SuperFiles</programlisting>
  1211. </sect2>
  1212. <sect2 id="FileExists">
  1213. <title><emphasis role="bold">FileExists</emphasis></title>
  1214. <para><emphasis role="bold">FileServices.FileExists(</emphasis><emphasis> filename
  1215. </emphasis><emphasis role="bold">[,
  1216. </emphasis><emphasis>physicalcheck</emphasis><emphasis role="bold">]
  1217. )</emphasis></para>
  1218. <para><emphasis>filename</emphasis> A null-terminated string
  1219. containing the logical name of the file.</para>
  1220. <para><emphasis>physicalcheck</emphasis> Optional. A boolean
  1221. TRUE/FALSE to indicate whether to check for the physical existence the
  1222. <emphasis>filename</emphasis> on disk. If omitted, the default is
  1223. FALSE.</para>
  1224. <para>Return:<emphasis> </emphasis>FileExists returns a BOOLEAN
  1225. value.</para>
  1226. <para>The <emphasis role="bold">FileExists </emphasis>function returns
  1227. TRUE if the specified <emphasis>filename</emphasis> is present in the
  1228. Distributed File Utility (DFU) and is not a SuperFile (use the
  1229. FileServices.SuperFileExists function to detect their presence or
  1230. absence). If <emphasis>physicalcheck</emphasis> is set to TRUE, then
  1231. the file’s physical presence on disk is also checked.</para>
  1232. <para>Example:</para>
  1233. <programlisting>A := FileServices.FileExists('~CLASS::RT::IN::People');</programlisting>
  1234. </sect2>
  1235. <sect2 id="ForeignLogicalFileName">
  1236. <title><emphasis role="bold">ForeignLogicalFileName</emphasis></title>
  1237. <para><emphasis role="bold">FileServices.ForeignLogicalFileName(</emphasis><emphasis>filename
  1238. </emphasis><emphasis role="bold">[,</emphasis><emphasis>foreigndali
  1239. </emphasis><emphasis role="bold">]
  1240. [,</emphasis><emphasis>absolutepath</emphasis><emphasis role="bold">]
  1241. )</emphasis></para>
  1242. <para><emphasis>filename</emphasis> A null-terminated string
  1243. containing the logical name of the file.</para>
  1244. <para><emphasis>foreigndali</emphasis> A null-terminated string
  1245. containing the IP address of the foreign Dali. If omitted, the
  1246. <emphasis>filename</emphasis> is presumed to be a foreign logical file
  1247. name, which is converted to a local logical file name.</para>
  1248. <para><emphasis>absolutepath</emphasis> Optional. A boolean TRUE/FALSE
  1249. to indicate whether to prepend a tilde (~) to the resulting foreign
  1250. logical file name. If omitted, the default is FALSE.</para>
  1251. <para>Return:<emphasis> </emphasis>ForeignLogicalFileName returns
  1252. returns a VARSTRING (null-terminated) value.</para>
  1253. <para>The <emphasis role="bold">ForeignLogicalFileName
  1254. </emphasis>function returns either a foreign logical file name (if the
  1255. <emphasis>foreigndali</emphasis> parameter is present) or a local
  1256. logical file name.</para>
  1257. <para>Example:</para>
  1258. <programlisting>sf := '~thor_data400::BASE::Business_Header';
  1259. ff := FileServices.ForeignLogicalFileName(sf,'10.150.29.161',true);
  1260. //results in: ~foreign::10.150.29.161::thor_data400::base::business_header
  1261. lf := FileServices.ForeignLogicalFileName(ff,'',true);
  1262. //results in: ~thor_data400::base::business_header</programlisting>
  1263. </sect2>
  1264. <sect2 id="FileServicesGetBuildInfo">
  1265. <title><emphasis role="bold">FS GetBuildInfo</emphasis></title>
  1266. <para><emphasis role="bold">FileServices.GetBuildInfo()</emphasis></para>
  1267. <para>Return:<emphasis> </emphasis>GetBuildInfo returns a VARSTRING
  1268. (null-terminated) value.</para>
  1269. <para>The <emphasis role="bold">GetBuildInfo </emphasis>functions
  1270. return a string containing information that specifies the build number
  1271. and date/time stamp of the supercomputer software.</para>
  1272. <para>Example:</para>
  1273. <programlisting>A := FileServices.GetBuildInfo();</programlisting>
  1274. </sect2>
  1275. <sect2 id="GetExpandLogicalFileName">
  1276. <title><emphasis role="bold">GetExpandLogicalFileName</emphasis></title>
  1277. <para><emphasis role="bold">ThorLib.GetExpandLogicalFileName(
  1278. </emphasis><emphasis>filename </emphasis><emphasis role="bold">)</emphasis></para>
  1279. <para><emphasis>filename</emphasis> A null-terminated string
  1280. containing the logical name of the file.</para>
  1281. <para>Return:<emphasis> </emphasis>GetExpandLogicalFileName returns a
  1282. VARSTRING (null-terminated) value.</para>
  1283. <para>The <emphasis role="bold">GetExpandLogicalFileName
  1284. </emphasis>function returns a string containing the expanded logical
  1285. filename (ncluding the default scope, if the filename does not contain
  1286. a leading tilde), all in lowercase. This is the same value as is used
  1287. internally by DATASET and OUTPUT.</para>
  1288. <para>Example:</para>
  1289. <programlisting>A := ThorLib.GetExpandLogicalFileName('Fred');</programlisting>
  1290. </sect2>
  1291. <sect2 id="GetFileDescription">
  1292. <title><emphasis role="bold">GetFileDescription</emphasis></title>
  1293. <para><emphasis role="bold">FileServices.GetFileDescription(
  1294. </emphasis><emphasis>filename </emphasis><emphasis role="bold">)</emphasis></para>
  1295. <para><emphasis>filename</emphasis> A null-terminated string
  1296. containing the logical name of the file.</para>
  1297. <para>Return:<emphasis> </emphasis>GetFileDescription returns a
  1298. VARSTRING (null-terminated) value.</para>
  1299. <para>The <emphasis role="bold">GetFileDescription </emphasis>function
  1300. returns a string containing the description information stored by the
  1301. DFU about the specified <emphasis>filename</emphasis>. This
  1302. description is set either through ECL watch or by using the
  1303. FileServices.SetFileDescription function.</para>
  1304. <para>Example:</para>
  1305. <programlisting>A := FileServices.GetFileDescription('Fred');</programlisting>
  1306. </sect2>
  1307. <sect2 id="RemoteDirectory">
  1308. <title><emphasis role="bold">RemoteDirectory</emphasis></title>
  1309. <para><emphasis role="bold">FileServices.RemoteDirectory(</emphasis><emphasis>
  1310. machineIP, directory </emphasis><emphasis role="bold">[</emphasis><emphasis>, mask </emphasis><emphasis role="bold">][</emphasis><emphasis>, includesubs </emphasis><emphasis role="bold">]</emphasis><emphasis> </emphasis><emphasis role="bold">)</emphasis></para>
  1311. <para><emphasis>machineIP</emphasis> A null-terminated string
  1312. containing the IP address of the remote machine.</para>
  1313. <para><emphasis>directory</emphasis> A null-terminated string
  1314. containing the path to the directory to read. This must be in the
  1315. appropriate format for the operating system running on the remote
  1316. machine.</para>
  1317. <para><emphasis>mask</emphasis> Optional. A null-terminated string
  1318. containing the filemask specifying which files to include in the
  1319. result. If omitted,the default is '*' (all files).</para>
  1320. <para><emphasis>includesubdir</emphasis> Optional. A boolean flag
  1321. indicating whether to include files from sub-directories under the
  1322. <emphasis>directory</emphasis>. If omitted, the default is
  1323. FALSE.</para>
  1324. <para>Return:<emphasis> </emphasis>RemoteDirectory returns a dataset
  1325. in the following format:</para>
  1326. <para>EXPORT FsFilenameRecord := RECORD</para>
  1327. <para>STRING name; //filename</para>
  1328. <para>UNSIGNED8 size; //filesize</para>
  1329. <para>STRING19 modified; //date-time stamp</para>
  1330. <para>END;</para>
  1331. <para>The <emphasis role="bold">RemoteDirectory </emphasis>function
  1332. returns a list of files as a dataset in the format listed above from
  1333. the specified <emphasis>machineIP</emphasis> and
  1334. <emphasis>directory</emphasis>. If <emphasis>includesubdir</emphasis>
  1335. is set to TRUE, then the name field contains the relative path to the
  1336. file from the specified <emphasis>directory</emphasis>.</para>
  1337. <para>Example:</para>
  1338. <programlisting>OUTPUT(FileServices.RemoteDirectory('edata12','\in','*.d00'));
  1339. OUTPUT(FileServices.RemoteDirectory('10.150.254.6',
  1340. '/c$/training',,TRUE));</programlisting>
  1341. </sect2>
  1342. <sect2 id="RenameLogicalFile">
  1343. <title><emphasis role="bold">RenameLogicalFile</emphasis></title>
  1344. <para><emphasis role="bold">FileServices.RenameLogicalFile(</emphasis><emphasis>
  1345. filename, newname </emphasis><emphasis role="bold">)</emphasis></para>
  1346. <para><emphasis>filename</emphasis> A null-terminated string
  1347. containing the current logical name of the file.</para>
  1348. <para><emphasis>newname</emphasis> A null-terminated string containing
  1349. the new logical name for the file.</para>
  1350. <para>The <emphasis role="bold">RenameLogicalFile </emphasis>function
  1351. changes the logical <emphasis>filename</emphasis> to the
  1352. <emphasis>newname</emphasis>.</para>
  1353. <para>Example:</para>
  1354. <programlisting>A := FileServices.RenameLogicalFile('Fred', 'Freddie');</programlisting>
  1355. </sect2>
  1356. <sect2 id="Replicate">
  1357. <title><emphasis role="bold">Replicate</emphasis></title>
  1358. <para><emphasis role="bold">FileServices.Replicate(</emphasis><emphasis> filename
  1359. </emphasis><emphasis role="bold">[</emphasis><emphasis>, timeout
  1360. </emphasis><emphasis role="bold">] [</emphasis><emphasis>,
  1361. espserverIPport</emphasis><emphasis role="bold">])</emphasis><emphasis>dfuwuid </emphasis><emphasis role="bold">:= FileServices.fReplicate(</emphasis><emphasis> filename
  1362. </emphasis><emphasis role="bold">[</emphasis><emphasis>, timeout
  1363. </emphasis><emphasis role="bold">] [</emphasis><emphasis>,
  1364. espserverIPport</emphasis><emphasis role="bold">]);</emphasis></para>
  1365. <para><emphasis>filename</emphasis> A null-terminated string
  1366. containing the logical name of the file.</para>
  1367. <para><emphasis>timeout</emphasis> Optional. An integer value
  1368. indicating the timeout setting. If omitted, the default is -1. If set
  1369. to zero (0), execution control returns immediately to the ECL workunit
  1370. without waiting for the DFU workunit to complete.</para>
  1371. <para><emphasis>espserverIPport</emphasis> Optional. A null-terminated
  1372. string containing the protocol, IP, port, and directory, or the DNS
  1373. equivalent, of the ESP server program. This is usually the same IP and
  1374. port as ECL Watch, with “/FileSpray” appended. If omitted, the default
  1375. is the value contained in the lib_system.ws_fs_server
  1376. attribute.</para>
  1377. <para><emphasis>dfuwuid</emphasis> The attribute name to recieve the
  1378. null-terminated string containing the DFU workunit ID (DFUWUID)
  1379. generated for the job.</para>
  1380. <para>The <emphasis role="bold">Replicate </emphasis>function copies
  1381. the individual parts of the <emphasis>filename</emphasis> to the
  1382. mirror disks for the cluster. Typically, this means that the file part
  1383. on one node’s C drive is copied to its neighbors D drive.</para>
  1384. <para>Example:</para>
  1385. <programlisting>A := FileServices.Replicate('Fred');</programlisting>
  1386. </sect2>
  1387. <sect2 id="SendEmail">
  1388. <title><emphasis role="bold">SendEmail</emphasis></title>
  1389. <para><emphasis role="bold">FileServices.SendEmail(
  1390. </emphasis><emphasis>sendto, subject, body, server, port,
  1391. sender</emphasis><emphasis role="bold"> )</emphasis></para>
  1392. <para><emphasis>sendto</emphasis> A null-terminated string containing
  1393. a comma-delimited list of the addresses of the intended recipients.
  1394. The validity of the addresses is not checked, so it is the
  1395. programmer’s responsibility to ensure they are all valid.</para>
  1396. <para><emphasis>subject</emphasis> A null-terminated string containing
  1397. the subject line.</para>
  1398. <para><emphasis>body</emphasis> A null-terminated string containing
  1399. the text of the email to send. This must be character encoding
  1400. “ISO-8859-1 (latin1)” (the ECL default character set). Text in any
  1401. other character set must be sent as an attachment (see the
  1402. FileServices.SendEmailAttachText() function).</para>
  1403. <para><emphasis>server</emphasis> Optional. A null-terminated string
  1404. containing the name of the mail server. If omitted, defaults to the
  1405. value in the lib_system.SMTPserver attribute.</para>
  1406. <para><emphasis>port</emphasis> Optional. An UNSIGNED4 integer value
  1407. containing the port number. If omitted, defaults to the value in the
  1408. lib_system.SMTPport attribute.</para>
  1409. <para><emphasis>sender</emphasis> Optional. A null-terminated string
  1410. containing the address of the sender. If omitted, defaults to the
  1411. value in the lib_system.emailAddress attribute.</para>
  1412. <para>The <emphasis role="bold">SendEmail </emphasis>function sends an
  1413. email message.</para>
  1414. <para>Example:</para>
  1415. <programlisting>FileServices.SendEmail( 'me@mydomain.com', 'testing 1,2,3', 'this is a test message');</programlisting>
  1416. </sect2>
  1417. <sect2 id="SendEmailAttachData">
  1418. <title><emphasis role="bold">SendEmailAttachData</emphasis></title>
  1419. <para><emphasis role="bold">FileServices.SendEmailAttachData(
  1420. </emphasis><emphasis>sendto, subject, body, attachment, mimietype,
  1421. filename, server, port, sender</emphasis><emphasis role="bold">
  1422. )</emphasis></para>
  1423. <para><emphasis>sendto</emphasis> A null-terminated string containing
  1424. a comma-delimited list of the addresses of the intended recipients.
  1425. The validity of the addresses is not checked, so it is the
  1426. programmer’s responsibility to ensure they are all valid.</para>
  1427. <para><emphasis>subject</emphasis> A null-terminated string containing
  1428. the subject line.</para>
  1429. <para><emphasis>body</emphasis> A null-terminated string containing
  1430. the text of the email to send. This must be character encoding
  1431. “ISO-8859-1 (latin1)” (the ECL default character set). Text in any
  1432. other character set must be sent as an
  1433. <emphasis>attachment</emphasis>.</para>
  1434. <para><emphasis>attachment</emphasis> A DATA value containing the
  1435. binary data to attach.</para>
  1436. <para><emphasis>mimetype</emphasis> A null-terminated string
  1437. containing the MIME-type of the <emphasis>attachment</emphasis>, which
  1438. may include parameters (such as ‘text/plain; charset=ISO-8859-3’).
  1439. When attaching general binary data for which no specific MIME type
  1440. exists, use ‘application/octet-stream’.</para>
  1441. <para><emphasis>filename</emphasis> A null-terminated string
  1442. containing the name of the <emphasis>attachment</emphasis> for the
  1443. mail reader to display.</para>
  1444. <para><emphasis>server</emphasis> Optional. A null-terminated string
  1445. containing the name of the mail server. If omitted, defaults to the
  1446. value in the lib_system.SMTPserver attribute.</para>
  1447. <para><emphasis>port</emphasis> Optional. An UNSIGNED4 integer value
  1448. containing the port number. If omitted, defaults to the value in the
  1449. lib_system.SMTPport attribute.</para>
  1450. <para><emphasis>sender</emphasis> Optional. A null-terminated string
  1451. containing the address of the sender. If omitted, defaults to the
  1452. value in the lib_system.emailAddress attribute.</para>
  1453. <para>The <emphasis role="bold">SendEmailAttachData
  1454. </emphasis>function sends an email message with a binary
  1455. <emphasis>attachment</emphasis>.</para>
  1456. <para>Example:</para>
  1457. <programlisting>DATA15 attachment := D'test attachment';
  1458. FileServices.SendEmailAttachData( 'me@mydomain.com',
  1459. 'testing 1,2,3',
  1460. 'this is a test message',
  1461. attachment,
  1462. 'application/octet-stream',
  1463. 'attachment.txt');</programlisting>
  1464. </sect2>
  1465. <sect2 id="SendEmailAttachText">
  1466. <title><emphasis role="bold">SendEmailAttachText</emphasis></title>
  1467. <para><emphasis role="bold">FileServices.SendEmailAttachText(
  1468. </emphasis><emphasis>sendto, subject, body, attachment, mimietype,
  1469. filename, server, port, sender</emphasis><emphasis role="bold">
  1470. )</emphasis></para>
  1471. <para><emphasis>sendto</emphasis> A null-terminated string containing
  1472. a comma-delimited list of the addresses of the intended recipients.
  1473. The validity of the addresses is not checked, so it is the
  1474. programmer’s responsibility to ensure they are all valid.</para>
  1475. <para><emphasis>subject</emphasis> A null-terminated string containing
  1476. the subject line.</para>
  1477. <para><emphasis>body</emphasis> A null-terminated string containing
  1478. the text of the email to send. This must be character encoding
  1479. “ISO-8859-1 (latin1)” (the ECL default character set). Text in any
  1480. other character set must be sent as an
  1481. <emphasis>attachment</emphasis>.</para>
  1482. <para><emphasis>attachment</emphasis> A null-terminated string
  1483. containing the text to attach.</para>
  1484. <para><emphasis>mimetype</emphasis> A null-terminated string
  1485. containing the MIME-type of the <emphasis>attachment</emphasis>, which
  1486. may include parameters (such as ‘text/plain;
  1487. charset=ISO-8859-3’).</para>
  1488. <para><emphasis>filename</emphasis> A null-terminated string
  1489. containing the name of the <emphasis>attachment</emphasis> for the
  1490. mail reader to display.</para>
  1491. <para><emphasis>server</emphasis> Optional. A null-terminated string
  1492. containing the name of the mail server. If omitted, defaults to the
  1493. value in the lib_system.SMTPserver attribute.</para>
  1494. <para><emphasis>port</emphasis> Optional. An UNSIGNED4 integer value
  1495. containing the port number. If omitted, defaults to the value in the
  1496. lib_system.SMTPport attribute.</para>
  1497. <para><emphasis>sender</emphasis> Optional. A null-terminated string
  1498. containing the address of the sender. If omitted, defaults to the
  1499. value in the lib_system.emailAddress attribute.</para>
  1500. <para>The <emphasis role="bold">SendEmailAttachText
  1501. </emphasis>function sends an email message with a text
  1502. <emphasis>attachment</emphasis>.</para>
  1503. <para>Example:</para>
  1504. <programlisting>FileServices.SendEmailAttachText( 'me@mydomain.com', 'testing 1,2,3',
  1505. 'this is a test message', 'this is a test attachment',
  1506. 'text/plain; charset=ISO-8859-3', 'attachment.txt');</programlisting>
  1507. </sect2>
  1508. <sect2 id="SetFileDescription">
  1509. <title><emphasis role="bold">SetFileDescription</emphasis></title>
  1510. <para><emphasis role="bold">FileServices.SetFileDescription(
  1511. </emphasis><emphasis>filename , value </emphasis><emphasis role="bold">)</emphasis></para>
  1512. <para><emphasis>filename</emphasis> A null-terminated string
  1513. containing the logical name of the file.</para>
  1514. <para><emphasis>value</emphasis> A null-terminated string containing
  1515. the description to place on the file.</para>
  1516. <para>The <emphasis role="bold">SetFileDescription </emphasis>function
  1517. changes the description information stored by the DFU about the
  1518. specified <emphasis>filename </emphasis>to the specified
  1519. <emphasis>value</emphasis>. This description is seen either through
  1520. ECL watch or by using the FileServices.GetFileDescription
  1521. function.</para>
  1522. <para>Example:</para>
  1523. <programlisting>A := FileServices.SetFileDescription('Fred','All the Freds in the world');</programlisting>
  1524. </sect2>
  1525. <sect2 id="SetReadOnly">
  1526. <title><emphasis role="bold">SetReadOnly</emphasis></title>
  1527. <para><emphasis role="bold">FileServices.SetReadOnly(</emphasis><emphasis> filename
  1528. </emphasis><emphasis role="bold">, </emphasis><emphasis>flag
  1529. </emphasis><emphasis role="bold">)</emphasis></para>
  1530. <para><emphasis>filename</emphasis> A null-terminated string
  1531. containing the logical name of the file.</para>
  1532. <para><emphasis>flag</emphasis> A boolean value indicating which way
  1533. to set the read-only attribute of the
  1534. <emphasis>filename</emphasis>.</para>
  1535. <para>The <emphasis role="bold">SetReadOnly </emphasis>function
  1536. toggles the read-only attribute of the filename. If the
  1537. <emphasis>flag</emphasis> is TRUE, read-only is set on.</para>
  1538. <para>Example:</para>
  1539. <programlisting>A := FileServices.SetReadOnly('Fred',TRUE);
  1540. //set read only flag on
  1541. </programlisting>
  1542. </sect2>
  1543. <sect2 id="VerifyFile">
  1544. <title><emphasis role="bold">VerifyFile</emphasis></title>
  1545. <para><emphasis role="bold">FileServices.VerifyFile(</emphasis><emphasis> file,
  1546. usecrcs </emphasis><emphasis role="bold">)</emphasis></para>
  1547. <para><emphasis>file</emphasis> A null-terminated string containing
  1548. the logical name of the file.</para>
  1549. <para><emphasis>usecrcs</emphasis> A boolean TRUE/FALSE flag
  1550. indicating that, when TRUE, compares physical CRCs of all the parts on
  1551. disk. This may be slow on large files.</para>
  1552. <para>Return:<emphasis> </emphasis>VerifyFile returns returns a
  1553. VARSTRING value.</para>
  1554. <para>The <emphasis role="bold">VerifyFile </emphasis>function checks
  1555. the system datastore (Dali) information for the
  1556. <emphasis>file</emphasis> against the physical parts on disk and
  1557. returns the following values:</para>
  1558. <para>OK The file parts match the datastore information</para>
  1559. <para>Could not find file: <emphasis>filename</emphasis><emphasis>
  1560. </emphasis> The logical <emphasis>filename</emphasis> was not
  1561. found</para>
  1562. <para>Could not find part file:
  1563. <emphasis>partname</emphasis><emphasis> </emphasis> The
  1564. <emphasis>partname</emphasis> was not found</para>
  1565. <para>Modified time differs for:
  1566. <emphasis>partname</emphasis><emphasis> </emphasis> The
  1567. <emphasis>partname</emphasis> has a different timestamp</para>
  1568. <para>File size differs for: <emphasis>partname</emphasis><emphasis>
  1569. </emphasis> The <emphasis>partname</emphasis> has a file size</para>
  1570. <para>File CRC differs for: <emphasis>partname</emphasis><emphasis>
  1571. </emphasis> The <emphasis>partname</emphasis> has a different
  1572. CRC</para>
  1573. <para>Example:</para>
  1574. <programlisting>A := FileServices.VerifyFile('Fred1', TRUE);
  1575. </programlisting>
  1576. </sect2>
  1577. </sect1>
  1578. <sect1 id="External_File_Support">
  1579. <title><emphasis>External File Support</emphasis></title>
  1580. <sect2 id="ExternalLogicalFileName">
  1581. <title><emphasis role="bold">ExternalLogicalFileName</emphasis></title>
  1582. <para><emphasis role="bold">FileServices.ExternalLogicalFileName(</emphasis><emphasis>
  1583. machineIP, filename </emphasis><emphasis role="bold">)</emphasis></para>
  1584. <para><emphasis>machineIP</emphasis> A null-terminated string
  1585. containing the IP address of the remote machine.</para>
  1586. <para><emphasis>filename</emphasis> A null-terminated string
  1587. containing the path/name of the file.</para>
  1588. <para>Return:<emphasis> </emphasis>ExternalLogicalFileName returns
  1589. returns a VARSTRING (null-terminated) value.</para>
  1590. <para>The <emphasis role="bold">ExternalLogicalFileName
  1591. </emphasis>function returns an appropriately encoded external logical
  1592. file name that can be used to directly read a file from any node that
  1593. is running the dafilesrv utility (typically a landing zone). It
  1594. handles upper case characters by escaping those characters inthe
  1595. return string.</para>
  1596. <para>Example:</para>
  1597. <programlisting>IP := '10.150.254.6';
  1598. file := '/c$/training/import/AdvancedECL/people';
  1599. DS1 := DATASET(FileServices.ExternalLogicalFileName(IP,file),
  1600. Training_Advanced.Layout_PeopleFile, FLAT);
  1601. OUTPUT(FileServices.ExternalLogicalFileName(IP,file));
  1602. //returns:
  1603. //~file::10.150.254.6::c$::training::import::^advanced^e^c^l::people
  1604. OUTPUT(DS1);
  1605. //returns records from the external file
  1606. </programlisting>
  1607. </sect2>
  1608. <sect2 id="GetHostName">
  1609. <title><emphasis role="bold">GetHostName</emphasis></title>
  1610. <para><emphasis>result</emphasis><emphasis role="bold"> :=
  1611. FileServices.GetHostName(</emphasis><emphasis> ip </emphasis><emphasis role="bold">);</emphasis></para>
  1612. <para><emphasis>ip</emphasis> A null-terminated string containing the
  1613. IP address of the remote machine.</para>
  1614. <para>Return:<emphasis> </emphasis>GetHostName returns returns a
  1615. VARSTRING (null-terminated) value.</para>
  1616. <para>The <emphasis role="bold">GetHostName </emphasis>function does a
  1617. reverse DNS lookup to return the host name for the machine at the
  1618. specified <emphasis>ip</emphasis> address.</para>
  1619. <para>Example:</para>
  1620. <programlisting>IP := '10.150.254.6';
  1621. OUTPUT(FileServices.GetHostName(IP));
  1622. </programlisting>
  1623. </sect2>
  1624. <sect2 id="ResolveHostName">
  1625. <title><emphasis role="bold">ResolveHostName</emphasis></title>
  1626. <para><emphasis>result</emphasis><emphasis role="bold"> :=
  1627. FileServices.ResolveHostName(</emphasis><emphasis> host
  1628. </emphasis><emphasis role="bold">);</emphasis></para>
  1629. <para><emphasis>host</emphasis> A null-terminated string containing
  1630. the DNS name of the remote machine.</para>
  1631. <para>Return:<emphasis> </emphasis>ResolveHostName returns returns a
  1632. VARSTRING (null-terminated) value.</para>
  1633. <para>The <emphasis role="bold">ResolveHostName </emphasis>function
  1634. does a DNS lookup to return the ip address for the specified
  1635. <emphasis>host</emphasis> name.</para>
  1636. <para>Example:</para>
  1637. <programlisting>host := 'dataland_dali.br.seisint.com';
  1638. OUTPUT(FileServices.ResolveHostName(host));
  1639. </programlisting>
  1640. </sect2>
  1641. <sect2 id="MoveExternalFile">
  1642. <title><emphasis role="bold">MoveExternalFile</emphasis></title>
  1643. <para><emphasis role="bold">FileServices.MoveExternalFile(</emphasis><emphasis>
  1644. location, frompath, topath </emphasis><emphasis role="bold">)</emphasis></para>
  1645. <para><emphasis>location</emphasis> A null-terminated string
  1646. containing the IP address of the remote machine.</para>
  1647. <para><emphasis>frompath</emphasis> A null-terminated string
  1648. containing the path/name of the file to move.</para>
  1649. <para><emphasis>topath</emphasis> A null-terminated string containing
  1650. the path/name of the target file.</para>
  1651. <para>The <emphasis role="bold">MoveExternalFile </emphasis>function
  1652. moves the single physical file specified by the
  1653. <emphasis>frompath</emphasis> to the <emphasis>topath</emphasis>. Both
  1654. <emphasis>frompath</emphasis> and <emphasis>topath</emphasis> are on
  1655. the same remote machine, identified by the
  1656. <emphasis>location</emphasis>. The dafileserv utility program must be
  1657. running on the <emphasis>location</emphasis> machine.</para>
  1658. <para>Example:</para>
  1659. <programlisting>IP := '10.150.254.6';
  1660. infile := '/c$/training/import/AdvancedECL/people';
  1661. outfile := '/c$/training/import/DFUtest/people';
  1662. FileServices.MoveExternalFile(IP,infile,outfile);</programlisting>
  1663. </sect2>
  1664. <sect2 id="DeleteExternalFile">
  1665. <title><emphasis role="bold">DeleteExternalFile</emphasis></title>
  1666. <para><emphasis role="bold">FileServices.DeleteExternalFile(</emphasis><emphasis>
  1667. location, path </emphasis><emphasis role="bold">)</emphasis></para>
  1668. <para><emphasis>location</emphasis> A null-terminated string
  1669. containing the IP address of the remote machine.</para>
  1670. <para><emphasis>path</emphasis> A null-terminated string containing
  1671. the path/name of the file to remove.</para>
  1672. <para>The <emphasis role="bold">DeleteExternalFile </emphasis>function
  1673. removes the single physical file specified by the
  1674. <emphasis>path</emphasis> from the <emphasis>location</emphasis>. The
  1675. dafileserv utility program must be running on the
  1676. <emphasis>location</emphasis> machine.</para>
  1677. <para>Example:</para>
  1678. <programlisting>IP := '10.150.254.6';
  1679. infile := '/c$/training/import/AdvancedECL/people';
  1680. FileServices.DeleteExternalFile(IP,infile);
  1681. </programlisting>
  1682. </sect2>
  1683. <sect2 id="CreateExternalDirectory">
  1684. <title><emphasis role="bold">CreateExternalDirectory</emphasis></title>
  1685. <para><emphasis role="bold">FileServices.CreateExternalDirectory(</emphasis><emphasis>
  1686. location, path </emphasis><emphasis role="bold">)</emphasis></para>
  1687. <para><emphasis>location</emphasis> A null-terminated string
  1688. containing the IP address of the remote machine.</para>
  1689. <para><emphasis>path</emphasis> A null-terminated string containing
  1690. the directory path to create.</para>
  1691. <para>The <emphasis role="bold">CreateExternalDirectory
  1692. </emphasis>function creates the <emphasis>path</emphasis> on the
  1693. <emphasis>location </emphasis>(if it does not already exist). The
  1694. dafileserv utility program must be running on the
  1695. <emphasis>location</emphasis> machine.</para>
  1696. <para>Example:</para>
  1697. <programlisting>IP := '10.150.254.6';
  1698. path := '/c$/training/import/NewDir';
  1699. FileServices.CreateExternalDirectory(IP,path);
  1700. </programlisting>
  1701. </sect2>
  1702. </sect1>
  1703. <sect1 id="Remote_File_Support">
  1704. <title><emphasis>Remote File Support</emphasis></title>
  1705. <para></para>
  1706. <para></para>
  1707. <sect2 id="RfsQuery">
  1708. <title><emphasis role="bold">RfsQuery</emphasis></title>
  1709. <para><emphasis>result</emphasis><emphasis role="bold"> :=
  1710. FileServices.RfsQuery(</emphasis><emphasis> server, query
  1711. </emphasis><emphasis role="bold">);</emphasis></para>
  1712. <para><emphasis>server</emphasis> A null-terminated string containing
  1713. the ip:port address for the remote file server.</para>
  1714. <para><emphasis>query</emphasis> A null-terminated string containing
  1715. the query to send to the <emphasis>server</emphasis>.</para>
  1716. <para>Return:<emphasis> </emphasis>RfsQuery returns a null-terminated
  1717. string containing the result of the <emphasis>query</emphasis>.</para>
  1718. <para>The <emphasis role="bold">RfsQuery </emphasis>function returns a
  1719. string that can be used in a DATASET declaration to read data from an
  1720. RFS (Remote File Server) instance (e.g. rfsmysql) on another
  1721. node.</para>
  1722. <para>Example:</para>
  1723. <programlisting>rfsserver := '10.173.207.1:7080';
  1724. rec := RECORD,MAXLENGTH(8192)
  1725. STRING mydata;
  1726. END;
  1727. OUTPUT(DATASET(FileServices.RfsQuery( rfsserver,
  1728. 'SELECT data FROM xml_testnh'),rec,CSV(MAXLENGTH(8192))));</programlisting>
  1729. </sect2>
  1730. <sect2 id="RfsAction">
  1731. <title><emphasis role="bold">RfsAction</emphasis></title>
  1732. <para><emphasis role="bold">FileServices.RfsAction(</emphasis><emphasis> server, query
  1733. </emphasis><emphasis role="bold">);</emphasis></para>
  1734. <para><emphasis>server</emphasis> A null-terminated string containing
  1735. the ip:port address for the remote file server.</para>
  1736. <para><emphasis>query</emphasis> A null-terminated string containing
  1737. the query to send to the <emphasis>server</emphasis>.</para>
  1738. <para>The <emphasis role="bold">RfsAction </emphasis>function sends
  1739. the <emphasis>query</emphasis> to the <emphasis>server</emphasis>.
  1740. This is used when there is no expected return value</para>
  1741. <para>Example:</para>
  1742. <programlisting>rfsserver := '10.173.207.1:7080';
  1743. FileServices.RfsAction(rfsserver,'INSERT INTO xml_testnh (data) VALUES (\''+TRIM(A)+'\' )');</programlisting>
  1744. </sect2>
  1745. </sect1>
  1746. <sect1 id="Field_Name_Token_Support">
  1747. <title><emphasis>Field Name Token Support</emphasis></title>
  1748. <sect2 id="FirstNameToToken">
  1749. <title><emphasis role="bold">FirstNameToToken</emphasis></title>
  1750. <para><emphasis>result</emphasis><emphasis role="bold"> :=
  1751. NameLib.FirstNameToToken(</emphasis><emphasis> name
  1752. </emphasis><emphasis role="bold">);</emphasis></para>
  1753. <para><emphasis>name</emphasis> A string expression containing the
  1754. name to tokenize. Maximum sixe: 20 characters.</para>
  1755. <para>Return:<emphasis> </emphasis>FirstNameToToken returns a
  1756. string.</para>
  1757. <para>The <emphasis role="bold">FirstNameToToken </emphasis>function
  1758. returns a string containing a tokenized representation of the
  1759. <emphasis>name</emphasis>..</para>
  1760. <para>Example:</para>
  1761. <programlisting>x := namelib.FirstNameToToken('Thompson');</programlisting>
  1762. </sect2>
  1763. <sect2 id="TokenToFirstName">
  1764. <title><emphasis role="bold">TokenToFirstName</emphasis></title>
  1765. <para><emphasis>result</emphasis><emphasis role="bold"> :=
  1766. NameLib.TokenToFirstName(</emphasis><emphasis> token
  1767. </emphasis><emphasis role="bold">);</emphasis></para>
  1768. <para><emphasis>token</emphasis> A string expression containing the
  1769. token resulting from the FirstNameToToken function.</para>
  1770. <para>Return:<emphasis> </emphasis>TokenToFirstName returns a
  1771. 20-character string.</para>
  1772. <para>The <emphasis role="bold">TokenToFirstName </emphasis>function
  1773. returns a string containing the name represented by the
  1774. <emphasis>token</emphasis>.</para>
  1775. <para>Example:</para>
  1776. <programlisting>y := namelib.TokenToFirstName(x); //returns 'Thompson'</programlisting>
  1777. </sect2>
  1778. <sect2 id="TokenToLength">
  1779. <title><emphasis role="bold">TokenToLength</emphasis></title>
  1780. <para><emphasis>result</emphasis><emphasis role="bold"> :=
  1781. NameLib.TokenToLength(</emphasis><emphasis> token </emphasis><emphasis role="bold">);</emphasis></para>
  1782. <para><emphasis>token</emphasis> A string expression containing the
  1783. token resulting from the FirstNameToToken function.</para>
  1784. <para>Return:<emphasis> </emphasis>TokenToLength returns an unsigned
  1785. 4-byte integer value.</para>
  1786. <para>The <emphasis role="bold">TokenToLength </emphasis>function
  1787. returns the number of characters in the
  1788. <emphasis>token</emphasis>.</para>
  1789. <para>Example:</para>
  1790. <programlisting>x := namelib.FirstNameToToken('Thompson');
  1791. y := namelib.TokenToFirstName(x);
  1792. z := namelib.TokenToLength(x);
  1793. ds := dataset([{x,y,z}],{string Tok, string Name, unsigned4 Len});
  1794. output(ds);</programlisting>
  1795. </sect2>
  1796. </sect1>
  1797. <sect1 id="File_Browsing_Support">
  1798. <title><emphasis>File Browsing Support</emphasis></title>
  1799. <sect2 id="SetColumnMapping">
  1800. <title><emphasis role="bold">SetColumnMapping</emphasis></title>
  1801. <para><emphasis role="bold">FileServices.SetColumnMapping(</emphasis><emphasis> file,
  1802. mapping </emphasis><emphasis role="bold">);</emphasis></para>
  1803. <para><emphasis>file</emphasis> A null-terminated string containing
  1804. the logical filename.</para>
  1805. <para><emphasis>mapping</emphasis> A null-terminated string containing
  1806. a comma-delimited list of field mappings.</para>
  1807. <para>The <emphasis role="bold">SetColumnMapping </emphasis>function
  1808. defines how the data in the fields of the <emphasis>file</emphasis>
  1809. mist be transformed between the actual data storage format and the
  1810. input format used to query that data.</para>
  1811. <para>The format for each field in the <emphasis>mapping</emphasis>
  1812. list is:</para>
  1813. <para><emphasis role="bold">&lt;field&gt;{set(&lt;transform&gt;(</emphasis><emphasis>args</emphasis><emphasis role="bold">),...),get(&lt;transform&gt;,...),displayname(&lt;</emphasis><emphasis>name</emphasis><emphasis role="bold">&gt;)}</emphasis></para>
  1814. <para><emphasis role="bold">&lt;field&gt;</emphasis> The name of the
  1815. field in the file.</para>
  1816. <para><emphasis role="bold">set</emphasis> Optional. Specifies the
  1817. transforms applied to the values supplied by the user to convert them
  1818. to values in the file.</para>
  1819. <para><emphasis role="bold">&lt;transform&gt;</emphasis> Optional. The
  1820. name of a function to apply to the value. This is typically the name
  1821. of a plugin function. The value being converted is always provided as
  1822. the first parameter to the function, but extra parameters can be
  1823. specified in brackets after the transform name (similar to SALT
  1824. hygiene).</para>
  1825. <para><emphasis role="bold">get</emphasis> Optional. Specifies the
  1826. transforms applied to the values in the file to convert them to the
  1827. formatted values as they are understood by the user.</para>
  1828. <para><emphasis role="bold">displayname</emphasis> Optional. Allows a
  1829. different <emphasis>name</emphasis> to be associated with the field
  1830. than the user would naturally understand.</para>
  1831. <para>Note that you may mix unicode and string functions, as the
  1832. system automatically converts the parameters to the appropriate types
  1833. expected for the functions.</para>
  1834. <para>Example:</para>
  1835. <programlisting>// A file where the firstname(string) and lastname(unicode) are
  1836. //always upper-cased:
  1837. // There is no need for a displayname since it isn't really a
  1838. // different field as far as the user is concerned, and there is
  1839. // obviously no get transformations.
  1840. firstname{set(stringlib.StringToUpperCase)},
  1841. surname{set(unicodelib.UnicodeToUpperCase)}
  1842. // A name translated using a phonetic key
  1843. // it is worth specifying a display name here, because it will make
  1844. // more sense to the user, and the user may want to enter either the
  1845. // translated or untranslated names.
  1846. dph_lname{set(metaphonelib.DMetaPhone1),
  1847. displayname(lname)}
  1848. // A file where a name is converted to a token using the namelib
  1849. // functions. (I don't think we have an example of this)
  1850. // (one of the few situations where a get() attribute is useful)
  1851. fnametoken{set(namelib.nameToToken),
  1852. get(namelib.tokenToName),
  1853. displayname(fname)}
  1854. // upper case, and only include digits and alphabetic.
  1855. searchname{set(stringlib.StringToUpperCase,
  1856. stringlib.StringFilter(
  1857. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'))}
  1858. // A file with a field that that needs to remove accents and then
  1859. // uppercase:
  1860. lastname{set(unicodeLIb.CleanAccents,stringLib.StringToUpperCase)}
  1861. </programlisting>
  1862. </sect2>
  1863. <sect2 id="GetColumnMapping">
  1864. <title><emphasis role="bold">GetColumnMapping</emphasis></title>
  1865. <para><emphasis>result</emphasis><emphasis role="bold"> :=
  1866. FileServices.GetColumnMapping(</emphasis><emphasis> file
  1867. </emphasis><emphasis role="bold">);</emphasis></para>
  1868. <para><emphasis>file</emphasis> A null-terminated string containing
  1869. the logical filename.</para>
  1870. <para>Return:<emphasis> </emphasis>GetColumnMapping returns a
  1871. null-terminated string containing the comma-delimited list of field
  1872. mappings for the <emphasis>file</emphasis>.</para>
  1873. <para>The <emphasis role="bold">GetColumnMapping </emphasis>function
  1874. returns the field mappings for the <emphasis>file</emphasis>, in the
  1875. same format specified for the SetColumnMapping function.</para>
  1876. <para>Example:</para>
  1877. <programlisting>Maps := FileServices.GetColumnMapping('Thor::in::SomeFile');
  1878. </programlisting>
  1879. </sect2>
  1880. <sect2 id="AddFileRelationship">
  1881. <title><emphasis role="bold">AddFileRelationship</emphasis></title>
  1882. <para><emphasis role="bold">FileServices.AddFileRelationship(</emphasis><emphasis>
  1883. primary, secondary,</emphasis><emphasis> primaryfields,
  1884. secondaryfields, </emphasis><emphasis role="bold"> [
  1885. </emphasis><emphasis>relationship </emphasis><emphasis role="bold">]</emphasis><emphasis>, cardinality, payload
  1886. </emphasis><emphasis role="bold"> [</emphasis><emphasis>, description
  1887. </emphasis><emphasis role="bold">] );</emphasis></para>
  1888. <para><emphasis>primary</emphasis> A null-terminated string containing
  1889. the logical filename of the primary file.</para>
  1890. <para><emphasis>secondary</emphasis> A null-terminated string
  1891. containing the logical filename of the secondary file.</para>
  1892. <para><emphasis>primaryfields</emphasis> A null-terminated string
  1893. containing the name of the primary key field for the
  1894. <emphasis>primary</emphasis> file. The value “__fileposition__”
  1895. indicates the <emphasis>secondary</emphasis> is an INDEX that must use
  1896. FETCH to access non-keyed fields.</para>
  1897. <para><emphasis>secondaryfields</emphasis> A null-terminated string
  1898. containing the name of the foreign key field relating to the
  1899. <emphasis>primary</emphasis> file.</para>
  1900. <para><emphasis>relationship</emphasis> A null-terminated string
  1901. containing either “link” or “view” indicating the type of relationship
  1902. between the <emphasis>primary</emphasis> and
  1903. <emphasis>secondary</emphasis> files. If omitted, the default is
  1904. “link.”</para>
  1905. <para><emphasis>cardinality</emphasis> A null-terminated string
  1906. containing the kind of relationship between the
  1907. <emphasis>primary</emphasis> and <emphasis>secondary</emphasis> files.
  1908. The format is X:Y where X indicates the <emphasis>primary</emphasis>
  1909. and Y indicates the <emphasis>secondary</emphasis>. Valid values for X
  1910. and Y are “1” or ‘M’.</para>
  1911. <para><emphasis>payload</emphasis> A BOOLEAN value indicating whether
  1912. the <emphasis>primary</emphasis> or <emphasis>secondary</emphasis> are
  1913. payload INDEXes.</para>
  1914. <para><emphasis>description</emphasis> A null-terminated string
  1915. containing the relationship description.</para>
  1916. <para>The <emphasis role="bold">AddFileRelationship</emphasis>
  1917. function defines the relationship between two files. These may be
  1918. DATASETs or INDEXes. Each record in the <emphasis>primary</emphasis>
  1919. file should be uniquely defined by the
  1920. <emphasis>primaryfields</emphasis> (ideally), preferably
  1921. efficiently.</para>
  1922. <para>The <emphasis>primaryfields</emphasis> and
  1923. <emphasis>secondaryfields</emphasis> parameters can have the same
  1924. format as the column mappings for a file (see the SetColumnMappings
  1925. function documentation) , although they will often be just a list of
  1926. fields.</para>
  1927. <para>They are currently used in two different ways:</para>
  1928. <para>First, the roxie browser needs a way of determining which
  1929. indexes are built from which files. A “view” relationship should be
  1930. added each time an index is built from a file, like this:</para>
  1931. <para>fileServices.AddFileRelationship(DG_FlatFileName,
  1932. DG_IndexFileName,</para>
  1933. <para>'', '', 'view', '1:1', false);</para>
  1934. <para>To implement the roxie browser there is no need to define the
  1935. <emphasis>primaryfields</emphasis> or
  1936. <emphasis>secondaryfields</emphasis>, so passing blank strings is
  1937. recommended.</para>
  1938. <para>Second, the browser needs a way of finding all the original
  1939. information from the file from an index.</para>
  1940. <para>This stage depends on the nature of the index:</para>
  1941. <para>a) If the index contains all the relevant data from the original
  1942. file you don’t need to do anything.</para>
  1943. <para>b) If the index uses a fileposition field to FETCH extra data
  1944. from the original file then add a relationship between the original
  1945. file and the index, using a special value of __fileposition__ to
  1946. indicate the record is retrieved using a FETCH.</para>
  1947. <para>fileServices.AddFileRelationship('fetch_file',
  1948. 'new_index',</para>
  1949. <para>'__fileposition__',</para>
  1950. <para>'index_filepos_field', 'link',</para>
  1951. <para>'1:1', true);</para>
  1952. <para>The original file is the primary, since the rows are uniquely
  1953. identified by the fileposition (also true of the index), and the
  1954. retrieval is efficient.</para>
  1955. <para>c) If the index uses a payload field which needs to be looked up
  1956. in another index to provide the information, then you need to define a
  1957. relationship between the new index and the index that provides the
  1958. extra information. The index providing the extra information is the
  1959. primary.</para>
  1960. <para>fileServices.AddFileRelationship('related_index',
  1961. 'new_index',</para>
  1962. <para>'related_key_fields',</para>
  1963. <para>'index_filepos_field', 'link',</para>
  1964. <para>'1:M', true);</para>
  1965. <para>The <emphasis>payload </emphasis>flag is there so that the roxie
  1966. browser can distinguish this link from a more general relationship
  1967. between two files.</para>
  1968. <para>You should ensure any super-file names are expanded if the
  1969. relation is defined between the particular sub-files.</para>
  1970. <para>While going through all the attributes it may be worth examining
  1971. whether it makes sense to add relationships for any other combinations
  1972. of files. It won’t have any immediate beneficial effect, but would
  1973. once we add an ER diagram to the system. A couple of examples may help
  1974. illustrate the syntax.</para>
  1975. <para>For a typical example, datasets with a household and person
  1976. file, the following defines a relationship linking by house hold id
  1977. (hhid):</para>
  1978. <para>fileServices.AddFileRelationship('HHFile','PersonFile',
  1979. 'hhid',</para>
  1980. <para>'hhid', 'link', '1:M', false);</para>
  1981. <para>Here’s a more hypothetical example—a file query with firstname,
  1982. lastname related to an index with phonetic names you might
  1983. have:</para>
  1984. <para>fileServices.AddFileRelationship('names', 'inquiries',</para>
  1985. <para>'plastname{set(phonetic)},pfirstname{set(phonetic)}',</para>
  1986. <para>'lastname{set(fail)},firstname{set(fail)}',</para>
  1987. <para>'link', '1:M', false);</para>
  1988. <para>Note, the fail mapping indicates that you can use the phonetic
  1989. mapping from inquiries to names, but there is no way of mapping from
  1990. names to inquiries. There could equally be get(fail) attributes on the
  1991. index fields.</para>
  1992. <para>Example:</para>
  1993. <programlisting>Maps := FileServices.GetColumnMapping('Thor::in::SomeFile');
  1994. </programlisting>
  1995. </sect2>
  1996. <sect2 id="FileRelationshipList">
  1997. <title><emphasis role="bold">FileRelationshipList</emphasis></title>
  1998. <para><emphasis role="bold">FileServices.FileRelationshipList(</emphasis><emphasis>
  1999. primary, secondary</emphasis><emphasis> </emphasis><emphasis role="bold">[</emphasis><emphasis>, primaryfields </emphasis><emphasis role="bold">]</emphasis><emphasis> </emphasis><emphasis role="bold">[</emphasis><emphasis>, secondaryfields
  2000. </emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2001. [</emphasis><emphasis>,</emphasis><emphasis role="bold">
  2002. </emphasis><emphasis>relationship </emphasis><emphasis role="bold">]);</emphasis></para>
  2003. <para><emphasis>primary</emphasis> A null-terminated string containing
  2004. the logical filename of the primary file.</para>
  2005. <para><emphasis>secondary</emphasis> A null-terminated string
  2006. containing the logical filename of the secondary file.</para>
  2007. <para><emphasis>primaryfields</emphasis> A null-terminated string
  2008. containing the name of the primary key field for the
  2009. <emphasis>primary</emphasis> file. The value “__fileposition__”
  2010. indicates the <emphasis>secondary</emphasis> is an INDEX that must use
  2011. FETCH to access non-keyed fields. If omitted, the default is an empty
  2012. string.</para>
  2013. <para><emphasis>secondaryfields</emphasis> A null-terminated string
  2014. containing the name of the foreign key field relating to the
  2015. <emphasis>primary</emphasis> file. If omitted, the default is an empty
  2016. string.</para>
  2017. <para><emphasis>relationship</emphasis> A null-terminated string
  2018. containing either “link” or “view” indicating the type of relationship
  2019. between the <emphasis>primary</emphasis> and
  2020. <emphasis>secondary</emphasis> files. If omitted, the default is
  2021. “link.”</para>
  2022. <para>Return: FileRelationshipList returns a dataset in the
  2023. FsFileRelationshipRecord format.</para>
  2024. <para>The <emphasis role="bold">FileRelationshipList</emphasis>
  2025. function returns a list file relationships between the
  2026. <emphasis>primary</emphasis> and <emphasis>secondary</emphasis> files.
  2027. The return records are structured in the FsFileRelationshipRecord
  2028. format:</para>
  2029. <para>EXPORT FsFileRelationshipRecord := RECORD</para>
  2030. <para>STRING primaryfile {MAXLENGTH(1023)};</para>
  2031. <para>STRING secondaryfile {MAXLENGTH(1023)};</para>
  2032. <para>STRING primaryflds {MAXLENGTH(1023)};</para>
  2033. <para>STRING secondaryflds {MAXLENGTH(1023)};</para>
  2034. <para>STRING kind {MAXLENGTH(16)};</para>
  2035. <para>STRING cardinality {MAXLENGTH(16)};</para>
  2036. <para>BOOLEAN payload;</para>
  2037. <para>STRING description {MAXLENGTH(1023)};</para>
  2038. <para>END;</para>
  2039. <para>Example:</para>
  2040. <programlisting>OUTPUT(fileServices.FileRelationshipList('names', 'inquiries'));
  2041. See Also: AddFileRelationship
  2042. </programlisting>
  2043. </sect2>
  2044. <sect2 id="RemoveFileRelationship">
  2045. <title><emphasis role="bold">RemoveFileRelationship</emphasis></title>
  2046. <para><emphasis role="bold">FileServices.RemoveFileRelationship(</emphasis><emphasis>
  2047. primary, secondary,</emphasis><emphasis> </emphasis><emphasis role="bold">[</emphasis><emphasis>, primaryfields </emphasis><emphasis role="bold">]</emphasis><emphasis> </emphasis><emphasis role="bold">[</emphasis><emphasis>, secondaryfields
  2048. </emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2049. [</emphasis><emphasis>,</emphasis><emphasis role="bold">
  2050. </emphasis><emphasis>relationship </emphasis><emphasis role="bold">]);</emphasis></para>
  2051. <para><emphasis>primary</emphasis> A null-terminated string containing
  2052. the logical filename of the primary file.</para>
  2053. <para><emphasis>secondary</emphasis> A null-terminated string
  2054. containing the logical filename of the secondary file.</para>
  2055. <para><emphasis>primaryfields</emphasis> A null-terminated string
  2056. containing the name of the primary key field for the
  2057. <emphasis>primary</emphasis> file. The value “__fileposition__”
  2058. indicates the <emphasis>secondary</emphasis> is an INDEX that must use
  2059. FETCH to access non-keyed fields. If omitted, the default is an empty
  2060. string.</para>
  2061. <para><emphasis>secondaryfields</emphasis> A null-terminated string
  2062. containing the name of the foreign key field relating to the
  2063. <emphasis>primary</emphasis> file. If omitted, the default is an empty
  2064. string.</para>
  2065. <para><emphasis>relationship</emphasis> A null-terminated string
  2066. containing either “link” or “view” indicating the type of relationship
  2067. between the <emphasis>primary</emphasis> and
  2068. <emphasis>secondary</emphasis> files. If omitted, the default is
  2069. “link.”</para>
  2070. <para>The <emphasis role="bold">RemoveFileRelationship</emphasis>
  2071. function removes a file relationshuip between the
  2072. <emphasis>primary</emphasis> and <emphasis>secondary</emphasis>
  2073. files.</para>
  2074. <para>Example:</para>
  2075. <programlisting>fileServices.RemoveFileRelationship('names', 'inquiries');
  2076. See Also: AddFileRelationship
  2077. </programlisting>
  2078. </sect2>
  2079. </sect1>
  2080. <sect1 id="Monitoring_Functions">
  2081. <title><emphasis>Monitoring Functions</emphasis></title>
  2082. <sect2 id="MonitorFile">
  2083. <title><emphasis role="bold">MonitorFile</emphasis></title>
  2084. <para><emphasis role="bold">FileServices.MonitorFile(</emphasis><emphasis> event,
  2085. </emphasis><emphasis role="bold">[</emphasis><emphasis> ip
  2086. </emphasis><emphasis role="bold">] , </emphasis><emphasis>filename,
  2087. </emphasis><emphasis role="bold">
  2088. [</emphasis><emphasis>,subdirs</emphasis><emphasis role="bold">]
  2089. [</emphasis><emphasis>,shotcount</emphasis><emphasis role="bold">]
  2090. [</emphasis><emphasis>,espserverIPport</emphasis><emphasis role="bold">] )</emphasis><emphasis>dfuwuid </emphasis><emphasis role="bold">:= FileServices.fMonitorFile(</emphasis><emphasis> event,
  2091. </emphasis><emphasis role="bold">[</emphasis><emphasis> ip
  2092. </emphasis><emphasis role="bold">] , </emphasis><emphasis>filename,
  2093. </emphasis><emphasis role="bold">
  2094. [</emphasis><emphasis>,subdirs</emphasis><emphasis role="bold">]
  2095. [</emphasis><emphasis>,shotcount</emphasis><emphasis role="bold">]
  2096. [</emphasis><emphasis>,espserverIPport</emphasis><emphasis role="bold">] );</emphasis></para>
  2097. <para><emphasis>event</emphasis> A null-terminated string containing
  2098. the user-defined name of the event to fire when the
  2099. <emphasis>filename</emphasis> appears. This value is used as the first
  2100. parameter to the EVENT function.</para>
  2101. <para><emphasis>ip</emphasis> Optional. A null-terminated string
  2102. containing the ip address for the file to monitor. This is typically a
  2103. landing zone. This may be omitted only if the
  2104. <emphasis>filename</emphasis> parameter contains a complete
  2105. URL.</para>
  2106. <para><emphasis>filename</emphasis> A null-terminated string
  2107. containing the full path to the file to monitor. This may contain
  2108. wildcard characters (* and ?).</para>
  2109. <para><emphasis>subdirs</emphasis> Optional. A boolean value
  2110. indicating whether to include files in sub-directories that match the
  2111. wildcard mask when the <emphasis>filename</emphasis> contains
  2112. wildcards. If omitted, the default is false.</para>
  2113. <para><emphasis>shotcount</emphasis> Optional. An integer value
  2114. indicating the number of times to generate the event before the
  2115. monitoring job completes. A negative one (-1) value indicates the
  2116. monitoring job continues until manually aborted. If omitted, the
  2117. default is 1.</para>
  2118. <para><emphasis>espserverIPport</emphasis> Optional. A null-terminated
  2119. string containing the protocol, IP, port, and directory, or the DNS
  2120. equivalent, of the ESP server program. This is usually the same IP and
  2121. port as ECL Watch, with “/FileSpray” appended. If omitted, the default
  2122. is the value contained in the lib_system.ws_fs_server
  2123. attribute.</para>
  2124. <para><emphasis>dfuwuid</emphasis> The attribute name to recieve the
  2125. null-terminated string containing the DFU workunit ID (DFUWUID)
  2126. generated for the monitoring job.</para>
  2127. <para>Return:<emphasis> </emphasis>fMonitorFile returns a
  2128. null-terminated string containing the DFU workunit ID
  2129. (DFUWUID).</para>
  2130. <para>The <emphasis role="bold">MonitorFile </emphasis>function
  2131. creates a file monitor job in the DFU Server. Once the job is received
  2132. it goes into a 'monitoring' mode (which can be seen in the eclwatch
  2133. DFU Workunit display), which polls at a fixed interval (settable by
  2134. configenv but default 15 mins). If an appropriately named file arrives
  2135. in this interval it will fire the <emphasis>event</emphasis> with the
  2136. name of the triggering object as the event subtype (see the EVENT
  2137. function).</para>
  2138. <para>This process continues until either:</para>
  2139. <para>1) The <emphasis>shotcount</emphasis> number of events have been
  2140. generated.</para>
  2141. <para>2) The user aborts the DFU workunit.</para>
  2142. <para>The FileServices.AbortDfuWorkunit and
  2143. FileServices.WaitDfuWorkunit functions can be used to abort or wait
  2144. for the DFU job by passing them the returned
  2145. <emphasis>dfuwuid</emphasis>.</para>
  2146. <para><emphasis role="bold">Note the following caveats and
  2147. restrictions:</emphasis></para>
  2148. <para>1) Events are only generated when the monitor job starts or
  2149. subsequently on the polling interval.</para>
  2150. <para>2) Note that the <emphasis>event</emphasis> is generated if the
  2151. file has been created since the last polling interval.-Therefore, the
  2152. <emphasis>event</emphasis> may occur before the file is closed and the
  2153. data all written. To ensure the file is not subsequently read before
  2154. it is complete you should use a technique that will preclude this
  2155. possibillity, such as using a separate 'flag' file instead of the
  2156. file, itself or renaming the file once it has been created and
  2157. completely written.</para>
  2158. <para>3) The EVENT function’s subtype parameter (its 2nd parameter)
  2159. when monitoring physical files is the full URL of the file, with an
  2160. absolute IP rather than DNS/netbios name of the file. This parameter
  2161. cannot be retrieved but can only be used for matching a particular
  2162. value.</para>
  2163. <para>Example:</para>
  2164. <programlisting>EventName := 'MyFileEvent';
  2165. FileName := 'c:\\test\\myfile';
  2166. LZ := '10.150.50.14';
  2167. FileServices.MonitorFile(EventName,LZ,FileName);
  2168. OUTPUT('File Found') : WHEN(EVENT(EventName,'*'),COUNT(1));
  2169. </programlisting>
  2170. </sect2>
  2171. <sect2 id="MonitorLogicalFileName">
  2172. <title><emphasis role="bold">MonitorLogicalFileName</emphasis></title>
  2173. <para><emphasis role="bold">FileServices.MonitorLogicalFileName(</emphasis><emphasis>
  2174. event, </emphasis><emphasis role="bold">
  2175. </emphasis><emphasis>filename, </emphasis><emphasis role="bold">
  2176. [</emphasis><emphasis>, shotcount </emphasis><emphasis role="bold">]
  2177. [</emphasis><emphasis>, espserverIPport </emphasis><emphasis role="bold">] )</emphasis><emphasis>dfuwuid </emphasis><emphasis role="bold">:=
  2178. FileServices.fMonitorLogicalFileName(</emphasis><emphasis> event,
  2179. </emphasis><emphasis role="bold"> </emphasis><emphasis>filename,
  2180. </emphasis><emphasis role="bold"> [</emphasis><emphasis>, shotcount
  2181. </emphasis><emphasis role="bold">] [</emphasis><emphasis>,
  2182. espserverIPport </emphasis><emphasis role="bold">]
  2183. );</emphasis></para>
  2184. <para><emphasis>event</emphasis> A null-terminated string containing
  2185. the user-defined name of the event to fire when the
  2186. <emphasis>filename</emphasis> appears. This value is used as the first
  2187. parameter to the EVENT function.</para>
  2188. <para><emphasis>filename</emphasis> A null-terminated string
  2189. containing the name of the logical file in the DFU to monitor. This
  2190. may contain wildcard characters ( * and ?).</para>
  2191. <para><emphasis>shotcount</emphasis> Optional. An integer value
  2192. indicating the number of times to generate the event before the
  2193. monitoring job completes. A negative one (-1) value indicates the
  2194. monitoring job continues until manually aborted. If omitted, the
  2195. default is 1.</para>
  2196. <para><emphasis>espserverIPport</emphasis> Optional. A null-terminated
  2197. string containing the protocol, IP, port, and directory, or the DNS
  2198. equivalent, of the ESP server program. This is usually the same IP and
  2199. port as ECL Watch, with “/FileSpray” appended. If omitted, the default
  2200. is the value contained in the lib_system.ws_fs_server
  2201. attribute.</para>
  2202. <para><emphasis>dfuwuid</emphasis> The attribute name to recieve the
  2203. null-terminated string containing the DFU workunit ID (DFUWUID)
  2204. generated for the monitoring job.</para>
  2205. <para>Return:<emphasis> </emphasis>fMonitorLogicalFileName returns a
  2206. null-terminated string containing the DFU workunit ID
  2207. (DFUWUID).</para>
  2208. <para>The <emphasis role="bold">MonitorLogicalFileName
  2209. </emphasis>function creates a file monitor job in the DFU Server. Once
  2210. the job is received it goes into a 'monitoring' mode (which can be
  2211. seen in the eclwatch DFU Workunit display), which polls at a fixed
  2212. interval (settable by configenv but default 15 mins). If an
  2213. appropriately named file arrives in this interval it will fire the
  2214. <emphasis>event</emphasis> with the name of the triggering object as
  2215. the event subtype (see the EVENT function).</para>
  2216. <para>This process continues until either:</para>
  2217. <para>1) The <emphasis>shotcount</emphasis> number of events have been
  2218. generated.</para>
  2219. <para>2) The user aborts the DFU workunit.</para>
  2220. <para>The FileServices.AbortDfuWorkunit and
  2221. FileServices.WaitDfuWorkunit functions can be used to abort or wait
  2222. for the DFU job by passing them the returned
  2223. <emphasis>dfuwuid</emphasis>.</para>
  2224. <para><emphasis role="bold">Note the following caveats and
  2225. restrictions:</emphasis></para>
  2226. <para>1) If a matching file already exists when the DFU Monitoring job
  2227. is started, that file will <emphasis role="underline">not</emphasis>
  2228. generate an event. It will only generate an event once the file has
  2229. been deleted and recreated.</para>
  2230. <para>2) If a file is created and then deleted (or deleted then
  2231. re-created) between polling intervals, it will not be seen by the
  2232. monitor and will not trigger an event.</para>
  2233. <para>3) Events are only generated on the polling interval.</para>
  2234. <para>Example:</para>
  2235. <programlisting>EventName := 'MyFileEvent';
  2236. FileName := 'test::myfile';
  2237. IF (FileServices.FileExists(FileName),
  2238. FileServices.DeleteLogicalFile(FileName));
  2239. FileServices.MonitorLogicalFileName(EventName,FileName);
  2240. OUTPUT('File Created') : WHEN(EVENT(EventName,'*'),COUNT(1));
  2241. rec := RECORD
  2242. STRING10 key;
  2243. STRING10 val;
  2244. END;
  2245. afile := DATASET([{ 'A', '0'}], rec);
  2246. OUTPUT(afile,,FileName);
  2247. </programlisting>
  2248. </sect2>
  2249. </sect1>
  2250. <sect1 id="File_Spray_and_Despray">
  2251. <title><emphasis>File Spray and Despray</emphasis></title>
  2252. <sect2 id="AbortDfuWorkunit">
  2253. <title><emphasis role="bold">AbortDfuWorkunit</emphasis></title>
  2254. <para><emphasis role="bold">FileServices.AbortDfuWorkunit(</emphasis><emphasis>
  2255. dfuwuid</emphasis><emphasis role="bold">
  2256. [</emphasis><emphasis>,espserverIPport </emphasis><emphasis role="bold">] )</emphasis></para>
  2257. <para><emphasis>dfuwuid</emphasis> A null-terminated string containing
  2258. the DFU workunit ID (DFUWUID) for the job to abort. This value is
  2259. returned by the “leading-f” versions of the Copy, DKC, SprayFixed,
  2260. SprayVariable, SprayXML, and Despray FileServices functions.</para>
  2261. <para><emphasis>espserverIPport</emphasis> Optional. A null-terminated
  2262. string containing the protocol, IP, port, and directory, or the DNS
  2263. equivalent, of the ESP server program. This is usually the same IP and
  2264. port as ECL Watch, with “/FileSpray” appended. If omitted, the default
  2265. is the value contained in the lib_system.ws_fs_server
  2266. attribute.</para>
  2267. <para>The <emphasis role="bold">AbortDfuWorkunit</emphasis> function
  2268. aborts the specified DFU workunit. Typically that workunit will have
  2269. been launched with its <emphasis>timeout </emphasis>parameter set to
  2270. zero (0).</para>
  2271. <para>Example:</para>
  2272. <programlisting>FileServices.AbortDfuWorkunit('D20051108-143758');
  2273. </programlisting>
  2274. </sect2>
  2275. <sect2 id="Copy">
  2276. <title><emphasis role="bold">Copy</emphasis></title>
  2277. <para><emphasis role="bold">FileServices.Copy(</emphasis><emphasis>
  2278. logicalname, destinationGroup</emphasis><emphasis role="bold">,
  2279. </emphasis><emphasis>destinationLogicalname, </emphasis><emphasis role="bold"> [</emphasis><emphasis>,scrDali</emphasis><emphasis role="bold">] [</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">] [</emphasis><emphasis>,espserverIPport
  2280. </emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2281. [</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]
  2282. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2283. [</emphasis><emphasis>,replicate</emphasis><emphasis role="bold">]
  2284. [</emphasis><emphasis>,asSuperfile</emphasis><emphasis role="bold">]
  2285. );</emphasis><emphasis>dfuwuid</emphasis><emphasis role="bold"> :=
  2286. FileServices.fCopy(</emphasis><emphasis> logicalname,
  2287. destinationGroup</emphasis><emphasis role="bold">,</emphasis><emphasis role="bold"> </emphasis><emphasis>destinationLogicalname,
  2288. </emphasis><emphasis role="bold">
  2289. [</emphasis><emphasis>,scrDali</emphasis><emphasis role="bold">]
  2290. [</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">]
  2291. [</emphasis><emphasis>,espserverIPport </emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2292. [</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]
  2293. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2294. [</emphasis><emphasis>,replicate</emphasis><emphasis role="bold">]
  2295. [</emphasis><emphasis>,asSuperfile</emphasis><emphasis role="bold">]
  2296. );</emphasis></para>
  2297. <para><emphasis>logicalname</emphasis> A null-terminated string
  2298. containing the logical name of the file.</para>
  2299. <para><emphasis>destinationGroup</emphasis> A null-terminated string
  2300. containing the destination cluster for the file.</para>
  2301. <para><emphasis>destinationLogicalname</emphasis>A null-terminated
  2302. string containing the new logical name of the file.</para>
  2303. <para><emphasis>srcDali</emphasis> Optional. A null-terminated string
  2304. containing the IP and Port of the Dali containing the file to copy. If
  2305. omitted, the default is an intra-Dali copy.</para>
  2306. <para><emphasis>timeout</emphasis> Optional. An integer value
  2307. indicating the timeout setting. If omitted, the default is -1. If set
  2308. to zero (0), execution control returns immediately to the ECL workunit
  2309. without waiting for the DFU workunit to complete.</para>
  2310. <para><emphasis>espserverIPport</emphasis> Optional. A null-terminated
  2311. string containing the protocol, IP, port, and directory, or the DNS
  2312. equivalent, of the ESP server program. This is usually the same IP and
  2313. port as ECL Watch, with “/FileSpray” appended. If omitted, the default
  2314. is the value contained in the lib_system.ws_fs_server
  2315. attribute.</para>
  2316. <para><emphasis>maxConnections</emphasis> Optional. An integer
  2317. specifying the maximum number of connections. If omitted, the default
  2318. is one (1).</para>
  2319. <para><emphasis>allowoverwrite</emphasis> Optional. A boolean TRUE or
  2320. FALSE flag indicating whether to allow the new file to overwrite an
  2321. existing file of the same name. If omitted, the default is
  2322. FALSE.</para>
  2323. <para><emphasis>replicate</emphasis> Optional. A boolean TRUE or FALSE
  2324. flag indicating whether to automatically replicate the new file. If
  2325. omitted, the default is FALSE.</para>
  2326. <para><emphasis>asSuperfile</emphasis> Optional. A boolean TRUE or
  2327. FALSE flag indicating whether to treat the file as a superfile. If
  2328. omitted, the default is FALSE. If TRUE and the file to copy is a
  2329. superfile, then the operation creates a superfile on the target,
  2330. creating subfiles as needed while overwriting only those already
  2331. existing subfiles whose content has changed. If FALSE and the file to
  2332. copy is a superfile, then the operation consolidates all the superfile
  2333. content into a single logical file on the target, not a
  2334. superfile.</para>
  2335. <para><emphasis>dfuwuid</emphasis> The attribute name to recieve the
  2336. null-terminated string containing the DFU workunit ID (DFUWUID)
  2337. generated for the job.</para>
  2338. <para>Return:<emphasis> </emphasis>fCopy returns a null-terminated
  2339. string containing the DFU workunit ID (DFUWUID).</para>
  2340. <para>The <emphasis role="bold">Copy </emphasis>function takes a
  2341. logical file and copies it to another logical file. This may be done
  2342. within the same cluster, or to another cluster, or to a cluster in a
  2343. completely separate Dali.</para>
  2344. <para>Example:</para>
  2345. <programlisting>FileServices.Copy('OUT::MyFile','400way','OUT::MyNewFile');
  2346. </programlisting>
  2347. </sect2>
  2348. <sect2 id="DeSpray">
  2349. <title><emphasis role="bold">DeSpray</emphasis></title>
  2350. <para><emphasis role="bold">FileServices.DeSpray(</emphasis><emphasis>
  2351. logicalname, destinationIP </emphasis><emphasis role="bold">,
  2352. </emphasis><emphasis>destinationpath, </emphasis><emphasis role="bold">[</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2353. [</emphasis><emphasis>,espserverIPport </emphasis><emphasis role="bold">]
  2354. [</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]
  2355. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">])</emphasis><emphasis>dfuwuid</emphasis><emphasis role="bold"> := FileServices.fDeSpray(</emphasis><emphasis>
  2356. logicalname, destinationIP </emphasis><emphasis role="bold">,
  2357. </emphasis><emphasis>destinationpath, </emphasis><emphasis role="bold"> [</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">] [</emphasis><emphasis>,espserverIPport
  2358. </emphasis><emphasis role="bold">]
  2359. [</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2360. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">]);</emphasis></para>
  2361. <para><emphasis>logicalname</emphasis> A null-terminated string
  2362. containing the logical name of the file.</para>
  2363. <para><emphasis>destinationIP</emphasis> A null-terminated string
  2364. containing the destination IP address of the file.</para>
  2365. <para><emphasis>destinationpath</emphasis> A null-terminated string
  2366. containing the path and name of the file.</para>
  2367. <para><emphasis>timeout</emphasis> Optional. An integer value
  2368. indicating the timeout setting. If omitted, the default is -1. If set
  2369. to zero (0), execution control returns immediately to the ECL workunit
  2370. without waiting for the DFU workunit to complete.</para>
  2371. <para><emphasis>espserverIPport</emphasis> Optional. A null-terminated
  2372. string containing the protocol, IP, port, and directory, or the DNS
  2373. equivalent, of the ESP server program. This is usually the same IP and
  2374. port as ECL Watch, with “/FileSpray” appended. If omitted, the default
  2375. is the value contained in the lib_system.ws_fs_server
  2376. attribute.</para>
  2377. <para><emphasis>maxConnections</emphasis> Optional. An integer
  2378. specifying the maximum number of connections. If omitted, the default
  2379. is one (1).</para>
  2380. <para><emphasis>allowoverwrite</emphasis> Optional. A boolean TRUE or
  2381. FALSE flag indicating whether to allow the new file to overwrite an
  2382. existing file of the same name. If omitted, the default is
  2383. FALSE.</para>
  2384. <para><emphasis>dfuwuid</emphasis> The attribute name to recieve the
  2385. null-terminated string containing the DFU workunit ID (DFUWUID)
  2386. generated for the job.</para>
  2387. <para>Return:<emphasis> </emphasis>fDeSpray returns a null-terminated
  2388. string containing the DFU workunit ID (DFUWUID).</para>
  2389. <para>The <emphasis role="bold">DeSpray </emphasis>function takes a
  2390. logical file and desprays it (combines all parts on each supercomputer
  2391. node into a single physical file) to the landing zone.</para>
  2392. <para>Example:</para>
  2393. <programlisting>FileServices.DeSpray('OUT::MyFile',
  2394. '10.150.50.14',
  2395. 'c:\\OutputData\\MyFile.txt',
  2396. -1,
  2397. 'http://10.150.50.12:8010/FileSpray');
  2398. </programlisting>
  2399. </sect2>
  2400. <sect2 id="DKC">
  2401. <title><emphasis role="bold">DKC</emphasis></title>
  2402. <para><emphasis role="bold">FileServices.DKC(</emphasis><emphasis>
  2403. logicalname, destinationIP </emphasis><emphasis role="bold">,
  2404. </emphasis><emphasis>destinationpath, </emphasis><emphasis role="bold">[</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2405. [</emphasis><emphasis>,espserverIPport </emphasis><emphasis role="bold">]
  2406. [</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]
  2407. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">])</emphasis><emphasis>dfuwuid</emphasis><emphasis role="bold"> := FileServices.fDKC(</emphasis><emphasis> logicalname,
  2408. destinationIP </emphasis><emphasis role="bold">,
  2409. </emphasis><emphasis>destinationpath, </emphasis><emphasis role="bold"> [</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">] [</emphasis><emphasis>,espserverIPport
  2410. </emphasis><emphasis role="bold">]
  2411. [</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2412. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">]);</emphasis></para>
  2413. <para><emphasis>logicalname</emphasis> A null-terminated string
  2414. containing the logical name of the file.</para>
  2415. <para><emphasis>destinationIP</emphasis> A null-terminated string
  2416. containing the destination IP address of the file.</para>
  2417. <para><emphasis>destinationpath</emphasis> A null-terminated string
  2418. containing the path and name of the file.</para>
  2419. <para><emphasis>timeout</emphasis> Optional. An integer value
  2420. indicating the timeout setting. If omitted, the default is -1. If set
  2421. to zero (0), execution control returns immediately to the ECL workunit
  2422. without waiting for the DFU workunit to complete.</para>
  2423. <para><emphasis>espserverIPport</emphasis> Optional. A null-terminated
  2424. string containing the protocol, IP, port, and directory, or the DNS
  2425. equivalent, of the ESP server program. This is usually the same IP and
  2426. port as ECL Watch, with “/FileSpray” appended. If omitted, the default
  2427. is the value contained in the lib_system.ws_fs_server
  2428. attribute.</para>
  2429. <para><emphasis>maxConnections</emphasis> Optional. An integer
  2430. specifying the maximum number of connections. If omitted, the default
  2431. is one (1).</para>
  2432. <para><emphasis>allowoverwrite</emphasis> Optional. A boolean TRUE or
  2433. FALSE flag indicating whether to allow the new file to overwrite an
  2434. existing file of the same name. If omitted, the default is
  2435. FALSE.</para>
  2436. <para><emphasis>dfuwuid</emphasis> The attribute name to recieve the
  2437. null-terminated string containing the DFU workunit ID (DFUWUID)
  2438. generated for the job.</para>
  2439. <para>Return:<emphasis> </emphasis>fDKC returns a null-terminated
  2440. string containing the DFU workunit ID (DFUWUID).</para>
  2441. <para>The <emphasis role="bold">DKC </emphasis>function takes an INDEX
  2442. file and desprays it (combines all parts on each supercomputer node
  2443. into a single physical file) to the landing zone.</para>
  2444. <para>Example:</para>
  2445. <programlisting>FileServices.DKC('OUT::MyIndex',
  2446. '10.150.50.14',
  2447. 'c:\\OutputData\\MyIndex.txt',
  2448. -1,
  2449. 'http://10.150.50.12:8010/FileSpray');
  2450. </programlisting>
  2451. </sect2>
  2452. <sect2 id="RemotePull">
  2453. <title><emphasis role="bold">RemotePull</emphasis></title>
  2454. <para><emphasis role="bold">FileServices.RemotePull(</emphasis><emphasis> remoteURL,
  2455. sourcelogicalname, destinationGroup</emphasis><emphasis role="bold">,</emphasis><emphasis role="bold">
  2456. </emphasis><emphasis>destinationlogicalname, </emphasis><emphasis role="bold">[</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">]
  2457. [</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2458. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">] [</emphasis><emphasis>,replicate</emphasis><emphasis role="bold">] [</emphasis><emphasis>,asSuperfile</emphasis><emphasis role="bold">])</emphasis><emphasis>dfuwuid</emphasis><emphasis role="bold"> := FileServices.RemotePull(</emphasis><emphasis>
  2459. remoteURL, sourcelogicalname,</emphasis><emphasis> destinationGroup
  2460. </emphasis><emphasis role="bold">,
  2461. </emphasis><emphasis>destinationlogicalname, </emphasis><emphasis role="bold">[</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2462. [</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]
  2463. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">] [</emphasis><emphasis>,replicate</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2464. [</emphasis><emphasis>,asSuperfile</emphasis><emphasis role="bold">]);</emphasis></para>
  2465. <para><emphasis>remoteURL</emphasis> A null-terminated string
  2466. containing the protocol, IP, port, and directory, or the DNS
  2467. equivalent, of the remote ESP server program. This is usually the same
  2468. IP and port as its ECL Watch, with “/FileSpray” appended.</para>
  2469. <para><emphasis>sourcelogicalname</emphasis> A null-terminated string
  2470. containing the local logical name of the file.</para>
  2471. <para><emphasis>destinationGroup</emphasis> A null-terminated string
  2472. containing the name of the destination cluster.</para>
  2473. <para><emphasis>destinationlogicalname</emphasis> A null-terminated
  2474. string containing the logical name to give the file on the remote
  2475. cluster (this must be completely specified, including the
  2476. domain).</para>
  2477. <para><emphasis>timeout</emphasis> Optional. An integer value
  2478. indicating the timeout setting. If omitted, the default is -1. If set
  2479. to zero (0), execution control returns immediately to the ECL workunit
  2480. without waiting for the DFU workunit to complete.</para>
  2481. <para><emphasis>maxConnections</emphasis> Optional. An integer
  2482. specifying the maximum number of connections. If omitted, the default
  2483. is one (1).</para>
  2484. <para><emphasis>allowoverwrite</emphasis> Optional. A boolean TRUE or
  2485. FALSE flag indicating whether to allow the new file to overwrite an
  2486. existing file of the same name. If omitted, the default is
  2487. FALSE.</para>
  2488. <para><emphasis>replicate</emphasis> Optional. A boolean TRUE or FALSE
  2489. flag indicating whether to automatically replicate the new file. If
  2490. omitted, the default is FALSE.</para>
  2491. <para><emphasis>asSuperfile</emphasis> Optional. A boolean TRUE or
  2492. FALSE flag indicating whether to treat the file as a superfile. If
  2493. omitted, the default is FALSE. If TRUE and the file to copy is a
  2494. superfile, then the operation creates a superfile on the target,
  2495. creating subfiles as needed while overwriting only those already
  2496. existing subfiles whose content has changed. If FALSE and the file to
  2497. copy is a superfile, then the operation consolidates all the superfile
  2498. content into a single logical file on the target, not a
  2499. superfile.</para>
  2500. <para><emphasis>dfuwuid</emphasis> The attribute name to recieve the
  2501. null-terminated string containing the DFU workunit ID (DFUWUID)
  2502. generated for the job.</para>
  2503. <para>Return:<emphasis> </emphasis>fRemotePull returns a
  2504. null-terminated string containing the DFU workunit ID
  2505. (DFUWUID).</para>
  2506. <para>The <emphasis role="bold">RemotePull </emphasis>function
  2507. executes on the <emphasis>remoteURL</emphasis>, copying the
  2508. <emphasis>sourcelogicalname</emphasis> from the local environment that
  2509. instantiated the operation to the remote environment’s
  2510. <emphasis>destinationGroup</emphasis> cluster, giving it the
  2511. <emphasis>destinationlogicalname</emphasis>. This is very similar to
  2512. using the FileServices.Copy function and specifying its
  2513. <emphasis>espserverIPport </emphasis>parameter. Since the DFU workunit
  2514. executes on the remote DFU server, the user name authentication must
  2515. be the same on both systems, and the use must have rights to copy
  2516. files on both systems.</para>
  2517. <para>Example:</para>
  2518. <programlisting>FileServices.RemotePull('http://10.150.50.14:8010/FileSpray',
  2519. '~THOR::LOCAL::MyFile',
  2520. 'RemoteThor',
  2521. '~REMOTETHOR::LOCAL::MyFile');
  2522. </programlisting>
  2523. </sect2>
  2524. <sect2 id="SprayFixed">
  2525. <title><emphasis role="bold">SprayFixed</emphasis></title>
  2526. <para><emphasis role="bold">FileServices.SprayFixed(</emphasis><emphasis> sourceIP
  2527. </emphasis><emphasis role="bold">, </emphasis><emphasis>sourcepath,
  2528. recordsize, destinationgroup,</emphasis><emphasis>
  2529. destinationlogicalname </emphasis><emphasis role="bold">[</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">] [</emphasis><emphasis>, espserverIPport
  2530. </emphasis><emphasis role="bold">]</emphasis><emphasis>
  2531. </emphasis><emphasis role="bold"> [</emphasis><emphasis>,
  2532. maxConnections </emphasis><emphasis role="bold">]
  2533. [</emphasis><emphasis>, allowoverwrite </emphasis><emphasis role="bold">] [</emphasis><emphasis>, replicate </emphasis><emphasis role="bold">]</emphasis><emphasis role="bold"> [</emphasis><emphasis>,
  2534. compress </emphasis><emphasis role="bold">])</emphasis><emphasis>dfuwuid</emphasis><emphasis role="bold"> := FileServices.fSprayFixed(</emphasis><emphasis>
  2535. sourceIP </emphasis><emphasis role="bold">,
  2536. </emphasis><emphasis>sourcepath, recordsize,</emphasis><emphasis>
  2537. destinationgroup, destinationlogicalname </emphasis><emphasis role="bold">[</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold"> [</emphasis><emphasis>,
  2538. espserverIPport </emphasis><emphasis role="bold">]</emphasis><emphasis> </emphasis><emphasis role="bold">[</emphasis><emphasis>, maxConnections
  2539. </emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2540. [</emphasis><emphasis>, allowoverwrite </emphasis><emphasis role="bold">] [</emphasis><emphasis>, replicate </emphasis><emphasis role="bold">] [</emphasis><emphasis>, compress </emphasis><emphasis role="bold">]);</emphasis></para>
  2541. <para><emphasis>sourceIP</emphasis> A null-terminated string
  2542. containing the IP address of the file.</para>
  2543. <para><emphasis>sourcepath</emphasis> A null-terminated string
  2544. containing the path and name of the file.</para>
  2545. <para><emphasis>recordsize</emphasis> An integer containing the size
  2546. of the records in the file.</para>
  2547. <para><emphasis>destinationgroup</emphasis> A null-terminated string
  2548. containing the name of the specific supercomputer within the target
  2549. cluster.</para>
  2550. <para><emphasis>destinationlogicalname</emphasis>A null-terminated
  2551. string containing the logical name of the file.</para>
  2552. <para><emphasis>timeout</emphasis> Optional. An integer value
  2553. indicating the timeout setting. If omitted, the default is -1. If set
  2554. to zero (0), execution control returns immediately to the ECL workunit
  2555. without waiting for the DFU workunit to complete.</para>
  2556. <para><emphasis>espserverIPport</emphasis> A null-terminated string
  2557. containing the protocol, IP, port, and directory, or the DNS
  2558. equivalent, of the ESP server program. This is usually the same IP and
  2559. port as ECL Watch, with “/FileSpray” appended. If omitted, the default
  2560. is the value contained in the lib_system.ws_fs_server
  2561. attribute.</para>
  2562. <para><emphasis>maxConnections</emphasis> Optional. An integer
  2563. specifying the maximum number of connections. If omitted, the default
  2564. is one (1).</para>
  2565. <para><emphasis>allowoverwrite</emphasis> Optional. A boolean TRUE or
  2566. FALSE flag indicating whether to allow the new file to overwrite an
  2567. existing file of the same name. If omitted, the default is
  2568. FALSE.</para>
  2569. <para><emphasis>replicate</emphasis> Optional. A boolean TRUE or FALSE
  2570. flag indicating whether to replicate the new file. If omitted, the
  2571. default is FALSE.</para>
  2572. <para><emphasis>compress</emphasis> Optional. A boolean TRUE or FALSE
  2573. flag indicating whether to compress the new file. If omitted, the
  2574. default is FALSE.</para>
  2575. <para><emphasis>dfuwuid</emphasis> The attribute name to recieve the
  2576. null-terminated string containing the DFU workunit ID (DFUWUID)
  2577. generated for the job.</para>
  2578. <para>Return:<emphasis> </emphasis>fSprayFixed returns a
  2579. null-terminated string containing the DFU workunit ID
  2580. (DFUWUID).</para>
  2581. <para>The <emphasis role="bold">SprayFixed </emphasis>function takes
  2582. fixed-format file from the landing zone and distributes it across the
  2583. nodes of the destination supercomputer.</para>
  2584. <para>Example:</para>
  2585. <programlisting>FileServices.SprayFixed('10.150.50.14','c:\\InputData\\MyFile.txt',
  2586. 255,'400way','IN::MyFile',-1,
  2587. 'http://10.150.50.12:8010/FileSpray');
  2588. </programlisting>
  2589. </sect2>
  2590. <sect2 id="SprayVariable">
  2591. <title><emphasis role="bold">SprayVariable</emphasis></title>
  2592. <para><emphasis role="bold">FileServices.SprayVariable(</emphasis><emphasis> sourceIP
  2593. </emphasis><emphasis role="bold">, </emphasis><emphasis>sourcepath ,
  2594. </emphasis><emphasis role="bold">[</emphasis><emphasis> maxrecordsize
  2595. </emphasis><emphasis role="bold">] </emphasis><emphasis>,
  2596. </emphasis><emphasis role="bold"> [</emphasis><emphasis>
  2597. srcCSVseparator </emphasis><emphasis role="bold">]
  2598. </emphasis><emphasis>, </emphasis><emphasis role="bold">[</emphasis><emphasis> srcCSVterminator
  2599. </emphasis><emphasis role="bold">] </emphasis><emphasis>,
  2600. </emphasis><emphasis role="bold">[</emphasis><emphasis> srcCSVquote
  2601. </emphasis><emphasis role="bold">] </emphasis><emphasis>,
  2602. </emphasis><emphasis role="bold">
  2603. </emphasis><emphasis>destinationgroup, destinationlogicalname
  2604. </emphasis><emphasis role="bold">[</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2605. [</emphasis><emphasis>,espserverIPport</emphasis><emphasis role="bold">]</emphasis><emphasis> </emphasis><emphasis role="bold">[</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2606. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">] [</emphasis><emphasis>,replicate</emphasis><emphasis role="bold">] [</emphasis><emphasis>, compress </emphasis><emphasis role="bold">])</emphasis><emphasis>dfuwuid</emphasis><emphasis role="bold"> := FileServices.fSprayVariable(</emphasis><emphasis>
  2607. sourceIP </emphasis><emphasis role="bold">,
  2608. </emphasis><emphasis>sourcepath , </emphasis><emphasis role="bold">
  2609. [</emphasis><emphasis> maxrecordsize </emphasis><emphasis role="bold">] </emphasis><emphasis>, </emphasis><emphasis role="bold">[</emphasis><emphasis> srcCSVseparator
  2610. </emphasis><emphasis role="bold">] </emphasis><emphasis>,
  2611. </emphasis><emphasis role="bold">[</emphasis><emphasis>
  2612. srcCSVterminator </emphasis><emphasis role="bold">]
  2613. </emphasis><emphasis>, </emphasis><emphasis role="bold">
  2614. [</emphasis><emphasis> srcCSVquote </emphasis><emphasis role="bold">]
  2615. </emphasis><emphasis>, destinationgroup, destinationlogicalname
  2616. </emphasis><emphasis role="bold">
  2617. [</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">]
  2618. [</emphasis><emphasis>,espserverIPport</emphasis><emphasis role="bold">]</emphasis><emphasis> </emphasis><emphasis role="bold">[</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2619. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">] [</emphasis><emphasis>,replicate</emphasis><emphasis role="bold">] [</emphasis><emphasis>, compress </emphasis><emphasis role="bold">]);</emphasis></para>
  2620. <para><emphasis>sourceIP</emphasis> A null-terminated string
  2621. containing the IP address of the file.</para>
  2622. <para><emphasis>sourcepath</emphasis> A null-terminated string
  2623. containing the path and name of the file.</para>
  2624. <para><emphasis>maxrecordsize</emphasis> Optional. An integer
  2625. containing the maximum size of the records in the file. If omitted,
  2626. the default is 4096.</para>
  2627. <para><emphasis>srcCSVseparator</emphasis> Optional. A null-terminated
  2628. string containing the CSV field separator. If omitted, the default is
  2629. '\\,'</para>
  2630. <para><emphasis>srcCSVterminator</emphasis>Optional. A null-terminated
  2631. string containing the CSV record separator. If omitted, the default is
  2632. '\\n,\\r,\\n'</para>
  2633. <para><emphasis>srcCSVquote</emphasis> Optional. A null-terminated
  2634. string containing the CSV quoted field delimiter. If omitted, the
  2635. default is '\''</para>
  2636. <para><emphasis>destinationgroup</emphasis> A null-terminated string
  2637. containing the name of the specific supercomputer within the target
  2638. cluster.</para>
  2639. <para><emphasis>destinationlogicalname</emphasis>A null-terminated
  2640. string containing the logical name of the file.</para>
  2641. <para><emphasis>timeout</emphasis> Optional. An integer value
  2642. indicating the timeout setting. If omitted, the default is -1. If set
  2643. to zero (0), execution control returns immediately to the ECL workunit
  2644. without waiting for the DFU workunit to complete.</para>
  2645. <para><emphasis>espserverIPport</emphasis> Optional. A null-terminated
  2646. string containing the protocol, IP, port, and directory, or the DNS
  2647. equivalent, of the ESP server program. This is usually the same IP and
  2648. port as ECL Watch, with “/FileSpray” appended. If omitted, the default
  2649. is the value in the lib_system.ws_fs_server attribute.</para>
  2650. <para><emphasis>maxConnections</emphasis> Optional. An integer
  2651. specifying the maximum number of connections. If omitted, the default
  2652. is one (1).</para>
  2653. <para><emphasis>allowoverwrite</emphasis> Optional. A boolean TRUE or
  2654. FALSE flag indicating whether to allow the new file to overwrite an
  2655. existing file of the same name. If omitted, the default is
  2656. FALSE.</para>
  2657. <para><emphasis>replicate</emphasis> Optional. A boolean TRUE or FALSE
  2658. flag indicating whether to replicate the new file. If omitted, the
  2659. default is FALSE.</para>
  2660. <para><emphasis>compress</emphasis> Optional. A boolean TRUE or FALSE
  2661. flag indicating whether to compress the new file. If omitted, the
  2662. default is FALSE.</para>
  2663. <para><emphasis>dfuwuid</emphasis> The attribute name to recieve the
  2664. null-terminated string containing the DFU workunit ID (DFUWUID)
  2665. generated for the job.</para>
  2666. <para>Return:<emphasis> </emphasis>fSprayVariable returns a
  2667. null-terminated string containing the DFU workunit ID
  2668. (DFUWUID).</para>
  2669. <para>The <emphasis role="bold">SprayVariable </emphasis>function
  2670. takes a variable length file from the landing zone and distributes it
  2671. across the nodes of the destination supercomputer.</para>
  2672. <para>Example:</para>
  2673. <programlisting>FileServices.SprayVariable('10.150.50.14',
  2674. 'c:\\InputData\\MyFile.txt',
  2675. ,,,,
  2676. '400way',
  2677. 'IN::MyFile',
  2678. -1,
  2679. 'http://10.150.50.12:8010/FileSpray');</programlisting>
  2680. </sect2>
  2681. <sect2 id="SprayXML">
  2682. <title><emphasis role="bold">SprayXML</emphasis></title>
  2683. <para><emphasis role="bold">FileServices.SprayXML(</emphasis><emphasis> sourceIP
  2684. </emphasis><emphasis role="bold">, </emphasis><emphasis>sourcepath ,
  2685. </emphasis><emphasis role="bold">[</emphasis><emphasis> maxrecordsize
  2686. </emphasis><emphasis role="bold">] </emphasis><emphasis>,
  2687. </emphasis><emphasis role="bold"> </emphasis><emphasis> srcRowTag
  2688. </emphasis><emphasis role="bold"> </emphasis><emphasis>,
  2689. </emphasis><emphasis role="bold">[</emphasis><emphasis> srcEncoding
  2690. </emphasis><emphasis role="bold">] </emphasis><emphasis>,
  2691. </emphasis><emphasis role="bold">
  2692. </emphasis><emphasis>destinationgroup, destinationlogicalname
  2693. </emphasis><emphasis role="bold">[</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2694. [</emphasis><emphasis>,espserverIPport</emphasis><emphasis role="bold">]</emphasis><emphasis> </emphasis><emphasis role="bold">[</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]</emphasis><emphasis role="bold">
  2695. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">] [</emphasis><emphasis>,replicate</emphasis><emphasis role="bold">] [</emphasis><emphasis>, compress </emphasis><emphasis role="bold">])</emphasis><emphasis>dfuwuid</emphasis><emphasis role="bold"> := FileServices.fSprayXML(</emphasis><emphasis>
  2696. sourceIP</emphasis><emphasis role="bold">,
  2697. </emphasis><emphasis>sourcepath, </emphasis><emphasis role="bold">[</emphasis><emphasis> maxrecordsize </emphasis><emphasis role="bold">] </emphasis><emphasis>, </emphasis><emphasis role="bold">
  2698. </emphasis><emphasis>srcRowTag</emphasis><emphasis role="bold">
  2699. </emphasis><emphasis>, </emphasis><emphasis role="bold">[</emphasis><emphasis> srcEncoding </emphasis><emphasis role="bold">]
  2700. </emphasis><emphasis>,destinationgroup,</emphasis><emphasis>
  2701. destinationlogicalname </emphasis><emphasis role="bold">[</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">]
  2702. [</emphasis><emphasis>,espserverIPport</emphasis><emphasis role="bold">]</emphasis><emphasis> </emphasis><emphasis role="bold">
  2703. [</emphasis><emphasis>,maxConnections</emphasis><emphasis role="bold">]
  2704. [</emphasis><emphasis>,allowoverwrite</emphasis><emphasis role="bold">] [</emphasis><emphasis>,replicate</emphasis><emphasis role="bold">] [</emphasis><emphasis>, compress </emphasis><emphasis role="bold">]);</emphasis></para>
  2705. <para><emphasis>sourceIP</emphasis> A null-terminated string
  2706. containing the IP address of the file.</para>
  2707. <para><emphasis>sourcepath</emphasis> A null-terminated string
  2708. containing the path and name of the file.</para>
  2709. <para><emphasis>maxrecordsize</emphasis> Optional. An integer
  2710. containing the maximum size of the records in the file. If omitted,
  2711. the default is 8192.</para>
  2712. <para><emphasis>srcRowTag</emphasis> A null-terminated string
  2713. containing the row delimiting XML tag.</para>
  2714. <para><emphasis>srcEncoding</emphasis> Optional. A null-terminated
  2715. string containing the encoding. If omitted, the default is
  2716. 'utf8'</para>
  2717. <para><emphasis>destinationgroup</emphasis> A null-terminated string
  2718. containing the name of the specific supercomputer within the target
  2719. cluster.</para>
  2720. <para><emphasis>destinationlogicalname</emphasis>A null-terminated
  2721. string containing the logical name of the file.</para>
  2722. <para><emphasis>timeout</emphasis> Optional. An integer value
  2723. indicating the timeout setting. If omitted, the default is -1. If set
  2724. to zero (0), execution control returns immediately to the ECL workunit
  2725. without waiting for the DFU workunit to complete.</para>
  2726. <para><emphasis>espserverIPport</emphasis> Optional. A null-terminated
  2727. string containing the protocol, IP, port, and directory, or the DNS
  2728. equivalent, of the ESP server program. This is usually the same IP and
  2729. port as ECL Watch, with “/FileSpray” appended. If omitted, the default
  2730. is the value contained in the lib_system.ws_fs_server
  2731. attribute.</para>
  2732. <para><emphasis>maxConnections</emphasis> Optional. An integer
  2733. specifying the maximum number of connections. If omitted, the default
  2734. is one (1).</para>
  2735. <para><emphasis>allowoverwrite</emphasis> Optional. A boolean TRUE or
  2736. FALSE flag indicating whether to allow the new file to overwrite an
  2737. existing file of the same name. If omitted, the default is
  2738. FALSE.</para>
  2739. <para><emphasis>replicate</emphasis> Optional. A boolean TRUE or FALSE
  2740. flag indicating whether to replicate the new file. If omitted, the
  2741. default is FALSE.</para>
  2742. <para><emphasis>compress</emphasis> Optional. A boolean TRUE or FALSE
  2743. flag indicating whether to compress the new file. If omitted, the
  2744. default is FALSE.</para>
  2745. <para><emphasis>dfuwuid</emphasis> The attribute name to recieve the
  2746. null-terminated string containing the DFU workunit ID (DFUWUID)
  2747. generated for the job.</para>
  2748. <para>Return:<emphasis> </emphasis>fSprayXML returns a null-terminated
  2749. string containing the DFU workunit ID (DFUWUID).</para>
  2750. <para>The <emphasis role="bold">SprayXML </emphasis>function takes a
  2751. well-formed XML file from the landing zone and distributes it across
  2752. the nodes of the destination supercomputer, producing a well-formed
  2753. XML file on each node.</para>
  2754. <para>Example:</para>
  2755. <programlisting>FileServices.SprayXML('10.150.50.14','c:\\InputData\\MyFile.txt',,
  2756. 'Row',,'400way','IN::MyFile',-1,
  2757. 'http://10.150.50.12:8010/FileSpray');</programlisting>
  2758. </sect2>
  2759. <sect2 id="WaitDfuWorkunit">
  2760. <title><emphasis role="bold">WaitDfuWorkunit</emphasis></title>
  2761. <para><emphasis role="bold">FileServices.WaitDfuWorkunit(</emphasis><emphasis>
  2762. dfuwuid</emphasis><emphasis role="bold">
  2763. [</emphasis><emphasis>,timeout</emphasis><emphasis role="bold">]
  2764. [</emphasis><emphasis>,espserverIPport </emphasis><emphasis role="bold">] )</emphasis></para>
  2765. <para><emphasis>dfuwuid</emphasis> A null-terminated string containing
  2766. the DFU workunit ID (DFUWUID) for the job to wait for. This value is
  2767. returned by the “leading-f” versions of the Copy, DKC, SprayFixed,
  2768. SprayVariable, SprayXML, and Despray FileServices functions.</para>
  2769. <para><emphasis>timeout</emphasis> Optional. An integer value
  2770. indicating the timeout setting. If omitted, the default is -1. If set
  2771. to zero (0), execution control returns immediately to the ECL workunit
  2772. without waiting for the DFU workunit to complete.</para>
  2773. <para><emphasis>espserverIPport</emphasis> Optional. A null-terminated
  2774. string containing the protocol, IP, port, and directory, or the DNS
  2775. equivalent, of the ESP server program. This is usually the same IP and
  2776. port as ECL Watch, with “/FileSpray” appended. If omitted, the default
  2777. is the value contained in the lib_system.ws_fs_server
  2778. attribute.</para>
  2779. <para>Return:<emphasis> </emphasis>WaitDfuWorkunit returns a
  2780. null-terminated string containing the final status string of the DFU
  2781. workunit (such as: scheduled, queued, started, aborted, failed,
  2782. finished, or monitoring).</para>
  2783. <para>The <emphasis role="bold">WaitDfuWorkunit</emphasis> function
  2784. waits for the specified DFU workunit to finish. Typically that
  2785. workunit will have been launched with its <emphasis>timeout
  2786. </emphasis>parameter set to zero (0).</para>
  2787. <para>Example:</para>
  2788. <programlisting>FileServices.WaitDfuWorkunit('D20051108-143758');</programlisting>
  2789. </sect2>
  2790. </sect1>
  2791. <sect1 id="SuperFile_Management">
  2792. <title><emphasis>SuperFile Management</emphasis></title>
  2793. <sect2 id="CreateSuperFile">
  2794. <title><emphasis role="bold">CreateSuperFile</emphasis></title>
  2795. <para><emphasis role="bold">FileServices.CreateSuperFile(</emphasis><emphasis>
  2796. superfile </emphasis><emphasis role="bold">[</emphasis><emphasis>,
  2797. sequentialflag </emphasis><emphasis role="bold">]
  2798. [</emphasis><emphasis>, ifdoesnotexist </emphasis><emphasis role="bold">]</emphasis><emphasis> </emphasis><emphasis role="bold">)</emphasis></para>
  2799. <para><emphasis>superfile</emphasis> A null-terminated string
  2800. containing the logical name of the superfile.</para>
  2801. <para><emphasis>sequentialflag</emphasis> Optional. A boolean value
  2802. indicating whether to the sub-files must be sequentially ordered. If
  2803. omitted, the default is FALSE.</para>
  2804. <para><emphasis>ifdoesnotexist</emphasis> Optional. A boolean value
  2805. indicating whether to post an error if the
  2806. <emphasis>superfile</emphasis> already exists. If TRUE, no error is
  2807. posted. If omitted, the default is FALSE.</para>
  2808. <para>Return:<emphasis> </emphasis>Null.</para>
  2809. <para>The <emphasis role="bold">CreateSuperFile </emphasis>function
  2810. creates an empty <emphasis>superfile</emphasis>. This function is not
  2811. included in a superfile transaction.</para>
  2812. <para>The <emphasis>sequentialflag</emphasis> parameter set to TRUE
  2813. governs the unusual case where the logical numbering of sub-files must
  2814. be sequential (for example, where all sub-files are already globally
  2815. sorted). With <emphasis>sequentialflag</emphasis> FALSE (the default)
  2816. the subfile parts are interleaved so the parts are found
  2817. locally.</para>
  2818. <para>For example, if on a 4-way cluster there are 3 files (A, B, and
  2819. C) then the parts are as follows:</para>
  2820. <para>A._1_of_4, B._1_of_4, and C_1_of_4 are on node 1 A._2_of_4,
  2821. B._2_of_4, and C_2_of_4 are on node 2 A._3_of_4, B._3_of_4, and
  2822. C_3_of_4 are on node 3 A._4_of_4, B._4_of_4, and C_4_of_4 are on node
  2823. 4</para>
  2824. <para>Reading the superfile created with
  2825. <emphasis>sequentialflag</emphasis> FALSE on Thor will read the parts
  2826. in the order:</para>
  2827. <para>[A1,B1,C1,] [A2,B2,C2,] [A3,B3,C3,] [A4,B4,C4]</para>
  2828. <para>so the reads will all be local (i.e. A1,B1,C1 on node 1 etc).
  2829. Setting <emphasis>sequentialflag</emphasis> to TRUE will read the
  2830. parts in subfile order, like this:</para>
  2831. <para>[A1,A2,A3,] [A4,B1,B2] [,B3,B4,C1,] [C2,C3,C4]</para>
  2832. <para>so that the global order of A,B,C,D is maintained. However, the
  2833. parts cannot all be read locally (e.g. A2 and A3 will be read on part
  2834. 1). Because of this it is much less efficient to set
  2835. <emphasis>sequentialflag</emphasis> true, and as it is unusual anyway
  2836. to have files that are partitioned in order, it becomes a very unusual
  2837. option to set.</para>
  2838. <para>Example:</para>
  2839. <programlisting>FileServices.CreateSuperFile('~CLASS::RT::IN::SF1');</programlisting>
  2840. </sect2>
  2841. <sect2 id="SuperFileExists">
  2842. <title><emphasis role="bold">SuperFileExists</emphasis></title>
  2843. <para><emphasis role="bold">FileServices.SuperFileExists(</emphasis><emphasis>
  2844. filename </emphasis><emphasis role="bold">)</emphasis></para>
  2845. <para><emphasis>filename</emphasis> A null-terminated string
  2846. containing the logical name of the superfile.</para>
  2847. <para>Return:<emphasis> </emphasis>SuperFileExists returns a BOOLEAN
  2848. value.</para>
  2849. <para>The <emphasis role="bold">SuperFileExists </emphasis>function
  2850. returns TRUE if the specified <emphasis>filename</emphasis> is present
  2851. in the Distributed File Utility (DFU) and is a SuperFile. It returns
  2852. FALSE if the <emphasis>filename</emphasis> does exist in the DFU but
  2853. is not a SuperFile (i.e. is a normal DATASET—use the
  2854. FileServices.FileExists function to detect their presence or
  2855. absence).</para>
  2856. <para>This function is not included in a superfile transaction.</para>
  2857. <para>Example:</para>
  2858. <programlisting>A := FileServices.SuperFileExists('~CLASS::RT::IN::SF1');</programlisting>
  2859. </sect2>
  2860. <sect2 id="DeleteSuperFile">
  2861. <title><emphasis role="bold">DeleteSuperFile</emphasis></title>
  2862. <para><emphasis role="bold">FileServices.DeleteSuperFile(</emphasis><emphasis>
  2863. superfile </emphasis><emphasis role="bold">[</emphasis><emphasis>,
  2864. subdeleteflag </emphasis><emphasis role="bold">]</emphasis><emphasis>
  2865. </emphasis><emphasis role="bold">)</emphasis></para>
  2866. <para><emphasis>superfile</emphasis> A null-terminated string
  2867. containing the logical name of the superfile.</para>
  2868. <para><emphasis>subdeleteflag</emphasis> A boolean value indicating
  2869. whether to delete the sub-files. If omitted, the default is FALSE.
  2870. <emphasis role="bold">This option should not be used if the
  2871. </emphasis><emphasis role="bold">superfile</emphasis><emphasis role="bold"> contains any foreign file or foreign
  2872. superfile.</emphasis></para>
  2873. <para>Return:<emphasis> </emphasis>Null.</para>
  2874. <para>The <emphasis role="bold">DeleteSuperFile </emphasis>function
  2875. deletes the <emphasis>superfile</emphasis>.</para>
  2876. <para>This function is not included in a superfile transaction.</para>
  2877. <para>Example:</para>
  2878. <programlisting>FileServices.DeleteSuperFile('~CLASS::RT::IN::SF1');</programlisting>
  2879. </sect2>
  2880. <sect2 id="GetSuperFileSubCount">
  2881. <title><emphasis role="bold">GetSuperFileSubCount</emphasis></title>
  2882. <para><emphasis role="bold">FileServices.GetSuperFileSubCount(</emphasis><emphasis>
  2883. superfile </emphasis><emphasis role="bold">)</emphasis></para>
  2884. <para><emphasis>superfile</emphasis> A null-terminated string
  2885. containing the logical name of the superfile.</para>
  2886. <para>Return:<emphasis> </emphasis>GetSuperFileSubCount returns an
  2887. INTEGER4 value.</para>
  2888. <para>The <emphasis role="bold">GetSuperFileSubCount
  2889. </emphasis>function returns the number of sub-files comprising the
  2890. <emphasis>superfile</emphasis>.</para>
  2891. <para>This function is not included in a superfile transaction.</para>
  2892. <para>Example:</para>
  2893. <programlisting>A := FileServices.GetSuperFileSubCount('~CLASS::RT::IN::SF1');</programlisting>
  2894. </sect2>
  2895. <sect2 id="GetSuperFileSubName">
  2896. <title><emphasis role="bold">GetSuperFileSubName</emphasis></title>
  2897. <para><emphasis role="bold">FileServices.GetSuperFileSubName(</emphasis><emphasis>
  2898. superfile, subfile </emphasis><emphasis role="bold">[,</emphasis><emphasis>absolutepath</emphasis><emphasis role="bold">] )</emphasis></para>
  2899. <para><emphasis>superfile</emphasis> A null-terminated string
  2900. containing the logical name of the superfile.</para>
  2901. <para><emphasis>subfile</emphasis> An integer in the range of one (1)
  2902. to the total number of sub-files in the <emphasis>superfile</emphasis>
  2903. specifying the ordinal position of the sub-file whose name to
  2904. return.</para>
  2905. <para><emphasis>absolutepath</emphasis> Optional. A boolean TRUE/FALSE
  2906. to indicate whether to prepend a tilde (~) to the resulting foreign
  2907. logical file name. If omitted, the default is FALSE.</para>
  2908. <para>Return:<emphasis> </emphasis>GetSuperFileSubName returns a
  2909. VARSTRING value.</para>
  2910. <para>The <emphasis role="bold">GetSuperFileSubName
  2911. </emphasis>function returns the logical name of the specified
  2912. <emphasis>subfile</emphasis> in the
  2913. <emphasis>superfile</emphasis>.</para>
  2914. <para>This function is not included in a superfile transaction.</para>
  2915. <para>Example:</para>
  2916. <programlisting>A := FileServices.GetSuperFileSubName('~CLASS::RT::IN::SF1', 1);
  2917. //get name of first sub-file
  2918. //this example gets the name of the first sub-file in
  2919. // a foreign superfile
  2920. sf := '~thor_data400::BASE::Business_Header';
  2921. sub := FileServices.GetSuperFileSubName( FileServices.ForeignLogicalFileName (sf,
  2922. '10.150.29.161',
  2923. TRUE),
  2924. 1,TRUE);
  2925. OUTPUT(FileServices.ForeignLogicalFileName(sub,''));</programlisting>
  2926. </sect2>
  2927. <sect2 id="LogicalFileSuperOwners">
  2928. <title><emphasis role="bold">LogicalFileSuperOwners</emphasis></title>
  2929. <para><emphasis role="bold">FileServices.LogicalFileSuperOwners(</emphasis><emphasis>
  2930. </emphasis><emphasis role="bold"> </emphasis><emphasis>filename
  2931. </emphasis><emphasis role="bold"> )</emphasis></para>
  2932. <para><emphasis>filename</emphasis> A null-terminated string
  2933. containing the logical name of the file.</para>
  2934. <para>Return:<emphasis> </emphasis>LogicalFileSuperOwners returns a
  2935. dataset in the following format:</para>
  2936. <para>EXPORT FsLogicalFileNameRecord := RECORD</para>
  2937. <para>STRING name;</para>
  2938. <para>END;</para>
  2939. <para>The <emphasis role="bold">LogicalFileSuperOwners
  2940. </emphasis>function returns a list of the logical filenames of all the
  2941. SuperFiles that contain the <emphasis>filename</emphasis> as a
  2942. sub-file.</para>
  2943. <para>This function is not included in a superfile transaction.</para>
  2944. <para>Example:</para>
  2945. <programlisting>OUTPUT(FileServices.LogicalFileSuperowners('~CLASS::RT::SF::Daily1'));
  2946. //returns all SuperFiles that “own” the Daily1 file</programlisting>
  2947. </sect2>
  2948. <sect2 id="LogicalFileSuperSubList">
  2949. <title><emphasis role="bold">LogicalFileSuperSubList</emphasis></title>
  2950. <para><emphasis role="bold">FileServices.LogicalFileSuperSubList(</emphasis><emphasis>
  2951. </emphasis><emphasis role="bold">)</emphasis></para>
  2952. <para>Return:<emphasis> </emphasis>LogicalFileSuperSubList returns a
  2953. dataset in the following format:</para>
  2954. <para>EXPORT FsLogicalSuperSubRecord := RECORD</para>
  2955. <para>STRING supername{MAXLENGTH(255)};</para>
  2956. <para>STRING subname{MAXLENGTH(255)};</para>
  2957. <para>END;</para>
  2958. <para>The <emphasis role="bold">LogicalFileSuperSubList
  2959. </emphasis>function returns a list of the logical filenames of all the
  2960. SuperFiles and their component sub-files.</para>
  2961. <para>This function is not included in a superfile transaction.</para>
  2962. <para>Example:</para>
  2963. <programlisting>OUTPUT(FileServices.LogicalFileSuperSubList());
  2964. //returns all SuperFiles and their sub-files</programlisting>
  2965. </sect2>
  2966. <sect2 id="SuperFileContents">
  2967. <title><emphasis role="bold">SuperFileContents</emphasis></title>
  2968. <para><emphasis role="bold">FileServices.SuperFileContents(</emphasis><emphasis>
  2969. </emphasis><emphasis role="bold"> </emphasis><emphasis>filename
  2970. </emphasis><emphasis role="bold">[</emphasis><emphasis>,
  2971. recurse</emphasis><emphasis role="bold"> ] )</emphasis></para>
  2972. <para><emphasis>filename</emphasis> A null-terminated string
  2973. containing the logical name of the SuperFile.</para>
  2974. <para><emphasis>recurse</emphasis> A boolean flag indicating whether
  2975. to expand nested SuperFiles withinthe filename so that only logical
  2976. files are returned. If omitted, the default is FALSE.</para>
  2977. <para>Return:<emphasis> </emphasis>SuperFileContents returns a dataset
  2978. in the following format:</para>
  2979. <para>EXPORT FsLogicalFileNameRecord := RECORD</para>
  2980. <para>STRING name;</para>
  2981. <para>END;</para>
  2982. <para>The <emphasis role="bold">SuperFileContents </emphasis>function
  2983. returns a list of the logical filenames of all the sub-files in the
  2984. <emphasis>filename</emphasis>.</para>
  2985. <para>This function is not included in a superfile transaction.</para>
  2986. <para>Example:</para>
  2987. <programlisting>OUTPUT(FileServices.SuperFileContents('~CLASS::RT::SF::Daily'));
  2988. //returns all files in the SuperFile</programlisting>
  2989. </sect2>
  2990. <sect2 id="FindSuperFileSubName">
  2991. <title><emphasis role="bold">FindSuperFileSubName</emphasis></title>
  2992. <para><emphasis role="bold">FileServices.FindSuperFileSubName(</emphasis><emphasis>
  2993. superfile, subfile </emphasis><emphasis role="bold">)</emphasis></para>
  2994. <para><emphasis>superfile</emphasis> A null-terminated string
  2995. containing the logical name of the superfile.</para>
  2996. <para><emphasis>subfile</emphasis> A null-terminated string containing
  2997. the logical name of the sub-file.</para>
  2998. <para>Return:<emphasis> </emphasis>FindSuperFileSubName returns an
  2999. INTEGER4 value.</para>
  3000. <para>The <emphasis role="bold">FindSuperFileSubName
  3001. </emphasis>function returns the ordinal position of the specified
  3002. <emphasis>subfile</emphasis> in the
  3003. <emphasis>superfile</emphasis>.</para>
  3004. <para>This function is not included in a superfile transaction.</para>
  3005. <para>Example:</para>
  3006. <programlisting>A := FileServices.GetSuperFileSubName('~CLASS::RT::IN::SF1', 'Sue'); //get position of sub-file Sue</programlisting>
  3007. </sect2>
  3008. <sect2 id="StartSuperFileTransaction">
  3009. <title><emphasis role="bold">StartSuperFileTransaction</emphasis></title>
  3010. <para><emphasis role="bold">FileServices.StartSuperFileTransaction(</emphasis><emphasis>
  3011. </emphasis><emphasis role="bold">)</emphasis></para>
  3012. <para>Return:<emphasis> </emphasis>Null.</para>
  3013. <para>The <emphasis role="bold">StartSuperFileTransaction
  3014. </emphasis>function begins a transaction frame for superfile
  3015. maintenance. The transaction frame is terminated by calling the
  3016. FinishSuperFileTransaction function. Within the transaction frame,
  3017. multiple superfiles may be maintained by adding, removing, clearing,
  3018. swapping, and replacing sub-files.</para>
  3019. <para>The FinishSuperFileTransaction function does an automatic
  3020. rollback of the transaction if any error or failure occurs during the
  3021. transaction frame. If no error occurs, then the commit or rollback of
  3022. the transaction is controlled by the <emphasis>rollback</emphasis>
  3023. parameter to the FinishSuperFileTransaction function.</para>
  3024. <para>Example:</para>
  3025. <programlisting>FileServices.StartSuperFileTransaction();</programlisting>
  3026. </sect2>
  3027. <sect2 id="AddSuperFile">
  3028. <title><emphasis role="bold">AddSuperFile</emphasis></title>
  3029. <para><emphasis role="bold">FileServices.AddSuperFile(</emphasis><emphasis> superfile,
  3030. subfile </emphasis><emphasis role="bold">[</emphasis><emphasis>, atpos
  3031. </emphasis><emphasis role="bold">] [</emphasis><emphasis>, addcontent
  3032. </emphasis><emphasis role="bold">] [</emphasis><emphasis>,strict
  3033. </emphasis><emphasis role="bold">])</emphasis></para>
  3034. <para><emphasis>superfile</emphasis> A null-terminated string
  3035. containing the logical name of the superfile.</para>
  3036. <para><emphasis>subfile</emphasis> A null-terminated string containing
  3037. the logical name of the sub-file. Ths may be another superfile.</para>
  3038. <para><emphasis>atpos</emphasis> An integer specifying the position of
  3039. the <emphasis>subfile</emphasis> in the
  3040. <emphasis>superfile</emphasis>. If omitted, the default is zero (0),
  3041. which places the <emphasis>subfile </emphasis>at the end of the
  3042. <emphasis>superfile</emphasis>.</para>
  3043. <para><emphasis>addcontent</emphasis> A boolean flag specifying
  3044. whether the contents of a <emphasis>subfile</emphasis> that is itself
  3045. a superfile are added to the <emphasis>superfile </emphasis>by copying
  3046. or by reference. If omitted, the default is to add by
  3047. reference.</para>
  3048. <para><emphasis>strict</emphasis> A boolean flag specifying, in the
  3049. case of a <emphasis>subfile</emphasis> that is itself a superfile,
  3050. whether to check for the existence of the superfile<emphasis>
  3051. </emphasis>and raising an error if it does not. Also, if
  3052. <emphasis>addcontent</emphasis> is set to TRUE, it will ensure the
  3053. <emphasis>subfile</emphasis> that is itself a superfile is not empty.
  3054. If omitted, the default is false.</para>
  3055. <para>Return:<emphasis> </emphasis>Null.</para>
  3056. <para>The <emphasis role="bold">AddSuperFile </emphasis>function adds
  3057. the <emphasis>subfile</emphasis> to the list of files comprising the
  3058. <emphasis>superfile</emphasis>. All <emphasis>subfiles</emphasis> in
  3059. the <emphasis>superfile</emphasis> must have exactly the same
  3060. structure type and format.</para>
  3061. <para>This function may be included in a superfile transaction.</para>
  3062. <para>Example:</para>
  3063. <programlisting>SEQUENTIAL(
  3064. FileServices.StartSuperFileTransaction(),
  3065. FileServices.AddSuperFile('MySuperFile','MySubFile'),
  3066. FileServices.FinishSuperFileTransaction()
  3067. );</programlisting>
  3068. </sect2>
  3069. <sect2 id="RemoveSuperFile">
  3070. <title><emphasis role="bold">RemoveSuperFile</emphasis></title>
  3071. <para><emphasis role="bold">FileServices.RemoveSuperFile(</emphasis><emphasis>
  3072. superfile, subfile </emphasis><emphasis role="bold">[</emphasis><emphasis>, delete</emphasis><emphasis role="bold">] [</emphasis><emphasis>,
  3073. removecontents</emphasis><emphasis role="bold">])</emphasis></para>
  3074. <para><emphasis>superfile</emphasis> A null-terminated string
  3075. containing the logical name of the superfile.</para>
  3076. <para><emphasis>subfile</emphasis> A null-terminated string containing
  3077. the logical name of the sub-file. This may be another superfile or a
  3078. foreign file or superfile.</para>
  3079. <para><emphasis>delete</emphasis> A boolean flag specifying whether to
  3080. delete the <emphasis>subfile</emphasis> from disk or just remove it
  3081. from the <emphasis>superfile </emphasis>list of files. If omitted, the
  3082. default is to just remove it from the <emphasis>superfile
  3083. </emphasis>list of files. <emphasis role="bold">This option should not
  3084. be used if the </emphasis><emphasis role="bold">subfile</emphasis><emphasis role="bold"> is a foreign file
  3085. or foreign superfile.</emphasis></para>
  3086. <para><emphasis>removecontents</emphasis> A boolean flag specifying
  3087. whether the contents of a <emphasis>subfile</emphasis> that is itself
  3088. a superfile are recursively removed.</para>
  3089. <para>Return:<emphasis> </emphasis>Null.</para>
  3090. <para>The <emphasis role="bold">RemoveSuperFile </emphasis>function
  3091. removes the <emphasis>subfile</emphasis> from the list of files
  3092. comprising the <emphasis>superfile</emphasis>.</para>
  3093. <para>This function may be included in a superfile transaction.</para>
  3094. <para>Example:</para>
  3095. <programlisting>SEQUENTIAL(
  3096. FileServices.StartSuperFileTransaction(),
  3097. FileServices.RemoveSuperFile('MySuperFile','MySubFile'),
  3098. FileServices.FinishSuperFileTransaction()
  3099. );</programlisting>
  3100. </sect2>
  3101. <sect2 id="ClearSuperFile">
  3102. <title><emphasis role="bold">ClearSuperFile</emphasis></title>
  3103. <para><emphasis role="bold">FileServices.ClearSuperFile(</emphasis><emphasis>
  3104. superfile, </emphasis><emphasis role="bold">[</emphasis><emphasis>,
  3105. delete </emphasis><emphasis role="bold">] )</emphasis></para>
  3106. <para><emphasis>superfile</emphasis> A null-terminated string
  3107. containing the logical name of the superfile.</para>
  3108. <para><emphasis>delete</emphasis> A boolean flag specifying whether to
  3109. delete the sub-files from disk or just remove them from the
  3110. <emphasis>superfile </emphasis>list of files. If omitted, the default
  3111. is to just remove them from the <emphasis>superfile </emphasis>list of
  3112. files.</para>
  3113. <para>Return:<emphasis> </emphasis>Null.</para>
  3114. <para>The <emphasis role="bold">ClearSuperFile </emphasis>function
  3115. removes all sub-files from the list of files comprising the
  3116. <emphasis>superfile</emphasis>.</para>
  3117. <para>This function may be included in a superfile transaction.</para>
  3118. <para>Example:</para>
  3119. <programlisting>SEQUENTIAL(
  3120. FileServices.StartSuperFileTransaction(),
  3121. FileServices.ClearSuperFile('MySuperFile'),
  3122. FileServices.FinishSuperFileTransaction()
  3123. );</programlisting>
  3124. </sect2>
  3125. <sect2 id="SwapSuperFile">
  3126. <title><emphasis role="bold">SwapSuperFile</emphasis></title>
  3127. <para><emphasis role="bold">FileServices.SwapSuperFile(</emphasis><emphasis>
  3128. superfile1, superfile2 </emphasis><emphasis role="bold">)</emphasis></para>
  3129. <para><emphasis>superfile1</emphasis> A null-terminated string
  3130. containing the logical name of the superfile.</para>
  3131. <para><emphasis>superfile2</emphasis> A null-terminated string
  3132. containing the logical name of the superfile.</para>
  3133. <para>Return:<emphasis> </emphasis>Null.</para>
  3134. <para>The <emphasis role="bold">SwapSuperFile </emphasis>function
  3135. moves all sub-files from <emphasis>superfile1 </emphasis>to
  3136. <emphasis>superfile2 </emphasis>and vice versa.</para>
  3137. <para>This function may be included in a superfile transaction.</para>
  3138. <para>Example:</para>
  3139. <programlisting>SEQUENTIAL(
  3140. FileServices.StartSuperFileTransaction(),
  3141. FileServices.SwapSuperFile('MySuperFile','YourSuperFile'),
  3142. FileServices.FinishSuperFileTransaction()
  3143. );</programlisting>
  3144. </sect2>
  3145. <sect2 id="ReplaceSuperFile">
  3146. <title><emphasis role="bold">ReplaceSuperFile</emphasis></title>
  3147. <para><emphasis role="bold">FileServices.ReplaceSuperFile(</emphasis><emphasis>
  3148. superfile, subfile1 , subfile2 </emphasis><emphasis role="bold">)</emphasis></para>
  3149. <para><emphasis>superfile</emphasis> A null-terminated string
  3150. containing the logical name of the superfile.</para>
  3151. <para><emphasis>subfile1</emphasis> A null-terminated string
  3152. containing the logical name of the sub-file. Ths may be another
  3153. superfile.</para>
  3154. <para><emphasis>subfile2</emphasis> A null-terminated string
  3155. containing the logical name of the sub-file. Ths may be another
  3156. superfile.</para>
  3157. <para>Return:<emphasis> </emphasis>Null.</para>
  3158. <para>The <emphasis role="bold">ReplaceSuperFile </emphasis>function
  3159. removes the <emphasis>subfile1</emphasis> from the list of files
  3160. comprising the <emphasis>superfile </emphasis>and replaces it with
  3161. <emphasis>subfile2</emphasis>.</para>
  3162. <para>This function may be included in a superfile transaction.</para>
  3163. <para>Example:</para>
  3164. <programlisting>SEQUENTIAL(
  3165. FileServices.StartSuperFileTransaction(),
  3166. FileServices.ReplaceSuperFile('MySuperFile',
  3167. 'MyOldSubFile',
  3168. 'MyNewSubFile'),
  3169. FileServices.FinishSuperFileTransaction()
  3170. );</programlisting>
  3171. </sect2>
  3172. <sect2 id="PromoteSuperFileList">
  3173. <title><emphasis role="bold">PromoteSuperFileList</emphasis></title>
  3174. <para><emphasis role="bold">FileServices.PromoteSuperFileList(</emphasis><emphasis>
  3175. superfiles </emphasis><emphasis role="bold">[</emphasis><emphasis>,
  3176. addhead </emphasis><emphasis role="bold">]</emphasis><emphasis>
  3177. </emphasis><emphasis role="bold">[</emphasis><emphasis>, deltail
  3178. </emphasis><emphasis role="bold">]</emphasis><emphasis>
  3179. </emphasis><emphasis role="bold"> [</emphasis><emphasis>,
  3180. createjustone </emphasis><emphasis role="bold">]</emphasis><emphasis>
  3181. </emphasis><emphasis role="bold">[</emphasis><emphasis>, reverse
  3182. </emphasis><emphasis role="bold">]</emphasis><emphasis>
  3183. </emphasis><emphasis role="bold">)</emphasis><emphasis>oldlist</emphasis><emphasis role="bold"> :=
  3184. FileServices.fPromoteSuperFileList(</emphasis><emphasis> superfiles
  3185. </emphasis><emphasis role="bold">[</emphasis><emphasis>, addhead
  3186. </emphasis><emphasis role="bold">]</emphasis><emphasis>
  3187. </emphasis><emphasis role="bold"> [</emphasis><emphasis>, deltail
  3188. </emphasis><emphasis role="bold">]</emphasis><emphasis>
  3189. </emphasis><emphasis role="bold">[</emphasis><emphasis>, createjustone
  3190. </emphasis><emphasis role="bold">]</emphasis><emphasis>
  3191. </emphasis><emphasis role="bold">[</emphasis><emphasis>, reverse
  3192. </emphasis><emphasis role="bold">]</emphasis><emphasis>
  3193. </emphasis><emphasis role="bold">);</emphasis></para>
  3194. <para><emphasis>superfiles</emphasis> A set of null-terminated strings
  3195. containing the logical names of the superfiles to act on. Any that
  3196. don’t exist will be created. The contents of each superfile will be
  3197. moved to the next in the list (NB -- each superfile must contain
  3198. different sub-files).</para>
  3199. <para><emphasis>addhead</emphasis> Optional. A null-terminated string
  3200. containing a comma-delimited list of logical file names to add to the
  3201. first <emphasis>superfile </emphasis>after the promotion process is
  3202. complete.</para>
  3203. <para><emphasis>deltail</emphasis> Optional. A boolean value
  3204. specifying whether to physically delete the contents moved out of the
  3205. last superfile. If omitted, the default is FALSE.</para>
  3206. <para><emphasis>createjustone</emphasis> Optional. A boolean value
  3207. specifying whether to only create a single superfile (truncate the
  3208. list at the first non-existent superfile). If omitted, the default is
  3209. FALSE.</para>
  3210. <para><emphasis>reverse</emphasis> Optional. A boolean value
  3211. specifying whether to reverse the order of procesing the
  3212. <emphasis>superfiles</emphasis> list, effectively “demoting” instead
  3213. of “promoting” the sub-files. If omitted, the default is FALSE.</para>
  3214. <para><emphasis>oldlist</emphasis> The name of the attribute that
  3215. receives the returned string containing the list of the previous
  3216. subfile contents of the emptied superfile.</para>
  3217. <para>Return:<emphasis> </emphasis>PromoteSupeFileList returns Null;
  3218. fPromoteSupeFileList returns a string.</para>
  3219. <para>The <emphasis role="bold">PromoteSuperFileList
  3220. </emphasis>function moves the subfiles from the first entry in the
  3221. list of <emphasis>superfiles</emphasis> to the next in the list,
  3222. subsequently repeating the process through the list of
  3223. <emphasis>superfiles</emphasis>.</para>
  3224. <para>This function does not use superfile transactions, it is an
  3225. atomic operation.</para>
  3226. <para>Example:</para>
  3227. <programlisting>FileServices.PromoteSuperFileList(['Super1','Super2','Super3'],
  3228. 'NewSub1');
  3229. //Moves what was in Super1 to Super2,
  3230. // what was in Super2 to Super3, replacing what was in Super3,
  3231. // and putting NewSub1 in Super1</programlisting>
  3232. </sect2>
  3233. <sect2 id="FinishSuperFileTransaction">
  3234. <title><emphasis role="bold">FinishSuperFileTransaction</emphasis></title>
  3235. <para><emphasis role="bold">FileServices.FinishSuperFileTransaction( [
  3236. </emphasis><emphasis>rollback </emphasis><emphasis role="bold">]
  3237. )</emphasis></para>
  3238. <para><emphasis>rollback</emphasis> Optional. A boolean flag that
  3239. indicates whether to commit (FALSE) or roll back (TRUE) the
  3240. transaction. If omitted, the default is FALSE.</para>
  3241. <para>Return:<emphasis> </emphasis>Null.</para>
  3242. <para>The <emphasis role="bold">FinishSuperFileTransaction
  3243. </emphasis>function terminates a superfile maintenance transaction
  3244. frame. If the <emphasis>rollback</emphasis> flag is FALSE, the
  3245. transction is committed atomically and the transaction frame closes.
  3246. Otherwise, the transaction is rolled back and the transaction frame
  3247. closes.</para>
  3248. <para>Example:</para>
  3249. <programlisting>FileServices.FinishSuperFileTransaction();</programlisting>
  3250. </sect2>
  3251. </sect1>
  3252. <sect1 id="Cluster_Handling">
  3253. <title><emphasis>Cluster Handling</emphasis></title>
  3254. <sect2 id="Cluster">
  3255. <title><emphasis role="bold">Cluster</emphasis></title>
  3256. <para><emphasis role="bold">Thorlib.Cluster(</emphasis><emphasis>
  3257. </emphasis><emphasis role="bold">)</emphasis></para>
  3258. <para>Return:<emphasis> </emphasis>Cluster returns a VARSTRING
  3259. value.</para>
  3260. <para>The <emphasis role="bold">Cluster </emphasis>function returns
  3261. the name of the cluster running the workunit. Not supported on Roxie
  3262. clusters. This name is used by ECLplus.exe to specify the the target
  3263. cluster for a workunit.</para>
  3264. <para>Example:</para>
  3265. <programlisting>A := Thorlib.Cluster();</programlisting>
  3266. </sect2>
  3267. <sect2 id="DaliServers">
  3268. <title><emphasis role="bold">DaliServers</emphasis></title>
  3269. <para><emphasis role="bold">Thorlib.DaliServers(</emphasis><emphasis>
  3270. </emphasis><emphasis role="bold">)</emphasis></para>
  3271. <para>Return:<emphasis> </emphasis>Daliservers returns a VARSTRING
  3272. value.</para>
  3273. <para>The <emphasis role="bold">Daliservers </emphasis>function
  3274. returns the IP and port of the system data store (Dali) servers for
  3275. the environment running the workunit.</para>
  3276. <para>Example:</para>
  3277. <programlisting>A := Thorlib.Daliservers();</programlisting>
  3278. </sect2>
  3279. <sect2 id="GetEnv">
  3280. <title><emphasis role="bold">GetEnv</emphasis></title>
  3281. <para><emphasis role="bold">Thorlib.GetEnv( </emphasis><emphasis>name,
  3282. default </emphasis><emphasis role="bold">)</emphasis></para>
  3283. <para><emphasis>name </emphasis>A null-terminated string containing
  3284. the name of the environment variable.</para>
  3285. <para><emphasis>default </emphasis>A null-terminated string containing
  3286. the default value of the environment variable.</para>
  3287. <para>Return:<emphasis> </emphasis>GetEnv returns a VARSTRING
  3288. value.</para>
  3289. <para>The <emphasis role="bold">GetEnv </emphasis>function returns the
  3290. value stored in the <emphasis>name</emphasis> environment variable. If
  3291. the environment variable does not exist or contains no value, the
  3292. <emphasis>default</emphasis> value is returned.</para>
  3293. <para>Example:</para>
  3294. <programlisting>A := Thorlib.GetEnv('SomeEnvironmentVar','Default');</programlisting>
  3295. </sect2>
  3296. <sect2 id="Group">
  3297. <title><emphasis role="bold">Group</emphasis></title>
  3298. <para><emphasis role="bold">Thorlib.Group( )</emphasis></para>
  3299. <para>Return:<emphasis> </emphasis>Group returns a VARSTRING
  3300. value.</para>
  3301. <para>The <emphasis role="bold">Group </emphasis>function returns the
  3302. name of the node group running the workunit. Not supported on Roxie
  3303. clusters. This name is used in ECL code to specify the target CLUSTER
  3304. for an OUTPUT action or a PERSISTed attribute.</para>
  3305. <para>Example:</para>
  3306. <programlisting>A := Thorlib.Group();</programlisting>
  3307. </sect2>
  3308. <sect2 id="JobName">
  3309. <title><emphasis role="bold">JobName</emphasis></title>
  3310. <para><emphasis role="bold">Thorlib.JobName(</emphasis><emphasis>
  3311. </emphasis><emphasis role="bold">)</emphasis></para>
  3312. <para>Return:<emphasis> </emphasis>JobName returns a VARSTRING
  3313. value.</para>
  3314. <para>The <emphasis role="bold">JobName </emphasis>function returns
  3315. the name of the workunit.</para>
  3316. <para>Example:</para>
  3317. <programlisting>A := Thorlib.JobName();</programlisting>
  3318. </sect2>
  3319. <sect2 id="JobOwner">
  3320. <title><emphasis role="bold">JobOwner</emphasis></title>
  3321. <para><emphasis role="bold">Thorlib.JobOwner(</emphasis><emphasis>
  3322. </emphasis><emphasis role="bold">)</emphasis></para>
  3323. <para>Return:<emphasis> </emphasis>JobOwner returns a VARSTRING
  3324. value.</para>
  3325. <para>The <emphasis role="bold">JobOwner </emphasis>function returns
  3326. the username of the person running the workunit.</para>
  3327. <para>Example:</para>
  3328. <programlisting>A := Thorlib.JobOwner();</programlisting>
  3329. </sect2>
  3330. <sect2 id="LogString">
  3331. <title><emphasis role="bold">LogString</emphasis></title>
  3332. <para><emphasis role="bold">Thorlib.LogString(
  3333. </emphasis><emphasis>message </emphasis><emphasis role="bold">)</emphasis></para>
  3334. <para><emphasis>message </emphasis>A string expression containinig the
  3335. text to place in the log file.</para>
  3336. <para>Return:<emphasis> </emphasis>LogString returns an INTEGER
  3337. value.</para>
  3338. <para>The <emphasis role="bold">LogString </emphasis>function outputs
  3339. “USER:” followed by the <emphasis>message</emphasis> text to the
  3340. eclagant or Roxie log file and returns the length of the text written
  3341. to the file.</para>
  3342. <para>Example:</para>
  3343. <programlisting>A := Thorlib.LogString('The text message to log');
  3344. //places USER:The text message to log
  3345. //in the log file </programlisting>
  3346. </sect2>
  3347. <sect2 id="OS">
  3348. <title><emphasis role="bold">OS</emphasis></title>
  3349. <para><emphasis role="bold">Thorlib.OS(</emphasis><emphasis>
  3350. </emphasis><emphasis role="bold">)</emphasis></para>
  3351. <para>Return:<emphasis> </emphasis>OS returns a VARSTRING
  3352. value.</para>
  3353. <para>The <emphasis role="bold">OS </emphasis>function returns the
  3354. operating system (windows or linux) of the cluster running the
  3355. workunit.</para>
  3356. <para>Example:</para>
  3357. <programlisting>A := Thorlib.OS();</programlisting>
  3358. </sect2>
  3359. <sect2 id="Platform">
  3360. <title><emphasis role="bold">Platform</emphasis></title>
  3361. <para><emphasis role="bold">Thorlib.Platform(</emphasis><emphasis>
  3362. </emphasis><emphasis role="bold">)</emphasis></para>
  3363. <para>Return:<emphasis> </emphasis>Platform returns a VARSTRING
  3364. value.</para>
  3365. <para>The <emphasis role="bold">Platform </emphasis>function returns
  3366. the platform name (hthor, thor, or roxie) of the cluster running the
  3367. workunit.</para>
  3368. <para>Example:</para>
  3369. <programlisting>A := Thorlib.Platform();</programlisting>
  3370. </sect2>
  3371. <sect2 id="Priority">
  3372. <title><emphasis role="bold">Priority</emphasis></title>
  3373. <para><emphasis role="bold">Thorlib.Priority(</emphasis><emphasis>
  3374. </emphasis><emphasis role="bold">)</emphasis></para>
  3375. <para>Return:<emphasis> </emphasis>Priority returns a VARSTRING
  3376. value.</para>
  3377. <para>The <emphasis role="bold">Priority </emphasis>function returns
  3378. the priority level of the workunit.</para>
  3379. <para>Example:</para>
  3380. <programlisting>A := Thorlib.Priority();</programlisting>
  3381. </sect2>
  3382. <sect2 id="L2P">
  3383. <title><emphasis role="bold">L2P</emphasis></title>
  3384. <para><emphasis role="bold">Thorlib.L2P(</emphasis><emphasis> filename
  3385. </emphasis><emphasis role="bold">[</emphasis><emphasis>, createflag
  3386. </emphasis><emphasis role="bold">]</emphasis><emphasis>
  3387. </emphasis><emphasis role="bold">)</emphasis></para>
  3388. <para><emphasis>filename</emphasis> A null-terminated string
  3389. containing the logical name of the file.</para>
  3390. <para><emphasis>createflag</emphasis> A boolean value indicating
  3391. whether to create the <emphasis>filename</emphasis>. If omitted, the
  3392. default is FALSE.</para>
  3393. <para>Return:<emphasis> </emphasis>L2P returns a VARSTRING
  3394. value.</para>
  3395. <para>The <emphasis role="bold">L2P </emphasis>function (Logical to
  3396. Physical) returns the physical name of the file represented by the
  3397. logical <emphasis>filename</emphasis>.</para>
  3398. <para>Example:</para>
  3399. <programlisting>A := Thorlib.L2P('Fred');</programlisting>
  3400. </sect2>
  3401. <sect2 id="Node">
  3402. <title><emphasis role="bold">Node</emphasis></title>
  3403. <para><emphasis role="bold">Thorlib.Node(</emphasis><emphasis>
  3404. </emphasis><emphasis role="bold">)</emphasis></para>
  3405. <para>Return:<emphasis> </emphasis>Node returns an UNSIGNED INTEGER4
  3406. value.</para>
  3407. <para>The <emphasis role="bold">Node </emphasis>function returns the
  3408. (zero-based) number of the Data Refinery (THOR) or Rapid Data Delivery
  3409. Engine (ROXIE) node.</para>
  3410. <para>Example:</para>
  3411. <programlisting>A := Thorlib.Node();</programlisting>
  3412. </sect2>
  3413. <sect2 id="Nodes">
  3414. <title><emphasis role="bold">Nodes</emphasis></title>
  3415. <para><emphasis role="bold">Thorlib.Nodes(</emphasis><emphasis>
  3416. </emphasis><emphasis role="bold">)</emphasis></para>
  3417. <para>Return:<emphasis> </emphasis>Nodes returns an UNSIGNED INTEGER4
  3418. value.</para>
  3419. <para>The <emphasis role="bold">Nodes </emphasis>function returns the
  3420. number of nodes in the cluster. This number is the same as the
  3421. CLUSTERSIZE compile time constant. The Nodes function is evaluated
  3422. each time it is called, so the choice to use the function versus the
  3423. constant depends upon the circumstances.</para>
  3424. <para>Example:</para>
  3425. <programlisting>A := Thorlib.Nodes();</programlisting>
  3426. </sect2>
  3427. <sect2 id="WUID">
  3428. <title><emphasis role="bold">WUID</emphasis></title>
  3429. <para><emphasis role="bold">Thorlib.WUID(</emphasis><emphasis>
  3430. </emphasis><emphasis role="bold">)</emphasis></para>
  3431. <para>Return:<emphasis> </emphasis>WUID returns a VARSTRING
  3432. value.</para>
  3433. <para>The <emphasis role="bold">WUID </emphasis>function returns the
  3434. workunit identifier of the current job. This is the same as the
  3435. WORKUNIT compile time constant. The WUID function is evaluated each
  3436. time it is called, so the choice to use the function versus the
  3437. constant depends upon the circumstances.</para>
  3438. <para>Example:</para>
  3439. <programlisting>A := Thorlib.WUID(); </programlisting>
  3440. </sect2>
  3441. </sect1>
  3442. <sect1 id="Word_Handling">
  3443. <title><emphasis>Word Handling</emphasis></title>
  3444. <sect2 id="Lead_Contains">
  3445. <title><emphasis role="bold">Lead_Contains</emphasis></title>
  3446. <para><emphasis role="bold">LIB_Word.Lead_Contains(</emphasis><emphasis> leftstring ,
  3447. rightstring </emphasis><emphasis role="bold">)</emphasis></para>
  3448. <para><emphasis>leftstring</emphasis> A string value.</para>
  3449. <para><emphasis>rightstring</emphasis> A string value.</para>
  3450. <para>Return:<emphasis> </emphasis>Lead_Contains returns a BOOLEAN
  3451. value.</para>
  3452. <para>The <emphasis role="bold">Lead_Contains </emphasis>function
  3453. returns TRUE if the <emphasis>leftstring</emphasis> and
  3454. <emphasis>rightstring</emphasis> both begin with the same characters.
  3455. It compares the shorter of the two parameters against the same number
  3456. of characters in the longer and returns TRUE if they match.</para>
  3457. <para>Example:</para>
  3458. <programlisting>Import LIB_Word;
  3459. A := LIB_Word.Lead_Contains('Fred','Jo');
  3460. //A contains False -- 'Jo' != 'Fr'
  3461. B := LIB_Word.Lead_Contains('Fred','Freddie');
  3462. //B contains True -- 'Fred' = 'Fred'</programlisting>
  3463. </sect2>
  3464. <sect2 id="StripTail">
  3465. <title><emphasis role="bold">StripTail</emphasis></title>
  3466. <para><emphasis role="bold">LIB_Word.StripTail(</emphasis><emphasis>
  3467. leftstring , stripstring </emphasis><emphasis role="bold">)</emphasis></para>
  3468. <para><emphasis>leftstring</emphasis> A string containing the word to
  3469. strip.</para>
  3470. <para><emphasis>stripstring</emphasis> A string containing the
  3471. characters to strip.</para>
  3472. <para>Return:<emphasis> </emphasis>StripTail returns a STRING
  3473. value.</para>
  3474. <para>The <emphasis role="bold">StripTail </emphasis>function returns
  3475. the <emphasis>leftstring</emphasis> with any
  3476. <emphasis>stripstring</emphasis> characters removed from the
  3477. end.</para>
  3478. <para>Example:</para>
  3479. <programlisting>Import LIB_Word;
  3480. A := 'FRED\'S'; // value is FRED’S
  3481. B := LIB_Word.StripTail(LIB_Word.StripTail(A,'\''),'\'S');
  3482. //B contains 'FRED' stripped of the possesive form FRED'S</programlisting>
  3483. </sect2>
  3484. <sect2 id="StripUpToWord">
  3485. <title><emphasis role="bold">StripUpToWord</emphasis></title>
  3486. <para><emphasis role="bold">LIB_Word.StripUpToWord(</emphasis><emphasis> leftstring ,
  3487. n </emphasis><emphasis role="bold">)</emphasis></para>
  3488. <para><emphasis>leftstring</emphasis> A string containing the words to
  3489. strip.</para>
  3490. <para><emphasis>n</emphasis> An integer containing the number of words
  3491. to strip.</para>
  3492. <para>Return:<emphasis> </emphasis>StripUpToWord returns a STRING
  3493. value.</para>
  3494. <para>The <emphasis role="bold">StripUpToWord </emphasis>function
  3495. returns the <emphasis>leftstring</emphasis> with
  3496. <emphasis>n</emphasis> number of words removed.</para>
  3497. <para>Example:</para>
  3498. <programlisting>Import LIB_Word;
  3499. A := 'FRED JO ME YOU';
  3500. B := LIB_Word.StripUpToWord(A,1);
  3501. //B contains 'JO ME YOU'
  3502. C := LIB_Word.StripUpToWord(A,2);
  3503. //C contains 'ME YOU'</programlisting>
  3504. </sect2>
  3505. <sect2 id="Tails">
  3506. <title><emphasis role="bold">Tails</emphasis></title>
  3507. <para><emphasis role="bold">LIB_Word.Tails(</emphasis><emphasis>
  3508. leftstring , rightstring </emphasis><emphasis role="bold">)</emphasis></para>
  3509. <para><emphasis>leftstring</emphasis> A string value.</para>
  3510. <para><emphasis>rightstring</emphasis> A string value.</para>
  3511. <para>Return:<emphasis> </emphasis>Tails returns a BOOLEAN
  3512. value.</para>
  3513. <para>The <emphasis role="bold">Tails </emphasis>function returns TRUE
  3514. if the <emphasis>leftstring</emphasis> ends with the same characters
  3515. as the <emphasis>rightstring</emphasis>.</para>
  3516. <para>Example:</para>
  3517. <programlisting>Import LIB_Word;
  3518. A1 := 'FRED\'S'; // value is FRED'S
  3519. A2 := 'FRED'; // value is FRED
  3520. B := '\'S'; //B contains 'S
  3521. C := LIB_Word.Tails(A1,B); // returns TRUE
  3522. D := LIB_Word.Tails(A2,B); // returns FALSE</programlisting>
  3523. </sect2>
  3524. <sect2 id="Word">
  3525. <title><emphasis role="bold">Word</emphasis></title>
  3526. <para><emphasis role="bold">LIB_Word.Word(</emphasis><emphasis>
  3527. leftstring , n </emphasis><emphasis role="bold">)</emphasis></para>
  3528. <para><emphasis>leftstring</emphasis> A string of space-delimited
  3529. words..</para>
  3530. <para><emphasis>n</emphasis> A 1-byte integer value specifying which
  3531. word to return.</para>
  3532. <para>Return:<emphasis> </emphasis>Word returns a STRING value.</para>
  3533. <para>The <emphasis role="bold">Word </emphasis>function returns the
  3534. <emphasis>n</emphasis>th word from the
  3535. <emphasis>leftstring</emphasis>.</para>
  3536. <para>Example:</para>
  3537. <programlisting>Import LIB_Word;
  3538. A := 'FRED JO ME YOU';
  3539. B := LIB_Word.Word(A,1);
  3540. //B contains 'FRED'
  3541. C := LIB_Word.Word(A,2);
  3542. //C contains 'JO'</programlisting>
  3543. </sect2>
  3544. </sect1>
  3545. <sect1 id="Date_Handling">
  3546. <title><emphasis>Date Handling</emphasis></title>
  3547. <sect2 id="Date_I2_YYYYMM">
  3548. <title><emphasis role="bold">Date_I2_YYYYMM</emphasis></title>
  3549. <para><emphasis role="bold">LIB_Date.Date_I2_YYYYMM(</emphasis><emphasis> date
  3550. </emphasis><emphasis role="bold">)</emphasis></para>
  3551. <para><emphasis>date</emphasis> An integer value containing a date
  3552. value in the form of the number of months since 1900 (January, 1900 =
  3553. 1 while January 2001 = 1213).</para>
  3554. <para>Return:<emphasis> </emphasis>Date_I2_YYYYMM returns a 6-byte
  3555. STRING value.</para>
  3556. <para>The <emphasis role="bold">Date_I2_YYYYMM </emphasis>function
  3557. returns the <emphasis>date</emphasis> integer value translated into a
  3558. YYYYMM string value.</para>
  3559. <para>Example:</para>
  3560. <programlisting>Import LIB_Date;
  3561. A := LIB_Date.Date_I2_YYYYMM(1213);
  3562. //A contains '200101'
  3563. B := LIB_Date.Date_I2_YYYYMM(1);
  3564. //B contains '190001'</programlisting>
  3565. </sect2>
  3566. <sect2 id="Date_MMDDYY_I2">
  3567. <title><emphasis role="bold">Date_MMDDYY_I2</emphasis></title>
  3568. <para><emphasis role="bold">LIB_Date.Date_MMDDYY_I2(</emphasis><emphasis> date
  3569. </emphasis><emphasis role="bold">)</emphasis></para>
  3570. <para><emphasis>date</emphasis> A 6-byte string value containing a
  3571. date in MMDDYY format.</para>
  3572. <para>Return:<emphasis> </emphasis>Date_MMDDYY_I2 returns an UNSIGNED
  3573. INTEGER value.</para>
  3574. <para>The <emphasis role="bold">Date_MMDDYY_I2 </emphasis>function
  3575. returns the <emphasis>date</emphasis> string value translated into an
  3576. integer containing the date in YYYYMMDD format. If the YY postion of
  3577. the date is &lt; 40, then the <emphasis>date</emphasis> is considered
  3578. to be after 2000, otherwise the <emphasis>date </emphasis>is
  3579. considered to be in the 1900’s. Therefore, the valid range of years
  3580. this function can handle is 1940 - 2039.</para>
  3581. <para>Example:</para>
  3582. <programlisting>Import LIB_Date;
  3583. A := LIB_Date.Date_MMDDYY_I2(' 010101');
  3584. //A contains the integer value 20010101 (20,010,101)
  3585. B := LIB_Date.Date_MMDDYY_I2(' 010145');
  3586. //B contains the integer value 19450101 (19,450,101)</programlisting>
  3587. </sect2>
  3588. <sect2 id="Date_Overlap">
  3589. <title><emphasis role="bold">Date_Overlap</emphasis></title>
  3590. <para><emphasis role="bold">LIB_Date.Date_Overlap(</emphasis><emphasis> leftfirst,
  3591. leftlast, rightfirst, rightlast </emphasis><emphasis role="bold">)</emphasis></para>
  3592. <para><emphasis>leftfirst</emphasis> An integer value containing the
  3593. start date of a date range in YYYYMM format.</para>
  3594. <para><emphasis>leftlast</emphasis> An integer value containing the
  3595. end date of a date range in YYYYMM format.</para>
  3596. <para><emphasis>rightfirst</emphasis> An integer value containing the
  3597. start date of a date range in YYYYMM format.</para>
  3598. <para><emphasis>rightlast</emphasis> An integer value containing the
  3599. end date of a date range in YYYYMM format.</para>
  3600. <para>Return:<emphasis> </emphasis>Date_Overlap returns an INTEGER
  3601. value.</para>
  3602. <para>The <emphasis role="bold">Date_Overlap </emphasis>function
  3603. returns the number of months of overlap between the
  3604. <emphasis>leftfirst</emphasis> to <emphasis>leftlast</emphasis> and
  3605. <emphasis>rightfirst </emphasis>to <emphasis>rightlast </emphasis>date
  3606. ranges.</para>
  3607. <para>Example:</para>
  3608. <programlisting>Import LIB_Date;
  3609. A := LIB_Date.date_overlap(200001,200303,200201,200302);
  3610. //A contains 13 -- the overlap from 200201 to 200302
  3611. </programlisting>
  3612. </sect2>
  3613. <sect2 id="Date_Overlap_First">
  3614. <title><emphasis role="bold">Date_Overlap_First</emphasis></title>
  3615. <para><emphasis role="bold">LIB_Date.Date_Overlap_First(</emphasis><emphasis>
  3616. leftfirst, leftlast, rightfirst, rightlast </emphasis><emphasis role="bold">)</emphasis></para>
  3617. <para><emphasis>leftfirst</emphasis> An integer value containing the
  3618. start date of a date range in YYYYMM format.</para>
  3619. <para><emphasis>leftlast</emphasis> An integer value containing the
  3620. end date of a date range in YYYYMM format.</para>
  3621. <para><emphasis>rightfirst</emphasis> An integer value containing the
  3622. start date of a date range in YYYYMM format.</para>
  3623. <para><emphasis>rightlast</emphasis> An integer value containing the
  3624. end date of a date range in YYYYMM format.</para>
  3625. <para>Return:<emphasis> </emphasis>Date_Overlap_First returns an
  3626. INTEGER value.</para>
  3627. <para>The <emphasis role="bold">Date_Overlap_First </emphasis>function
  3628. returns the starting overlap date between the
  3629. <emphasis>leftfirst</emphasis> to <emphasis>leftlast</emphasis> and
  3630. <emphasis>rightfirst </emphasis>to <emphasis>rightlast </emphasis>date
  3631. ranges.</para>
  3632. <para>Example:</para>
  3633. <programlisting>Import LIB_Date;
  3634. A := LIB_Date.date_overlap_first(200001,200303,200201,200302);
  3635. //A contains 200201 -- the two ranges overlap from 200201 to 200302
  3636. </programlisting>
  3637. </sect2>
  3638. <sect2 id="Date_Overlap_Last">
  3639. <title><emphasis role="bold">Date_Overlap_Last</emphasis></title>
  3640. <para><emphasis role="bold">LIB_Date.Date_Overlap_Last(</emphasis><emphasis>
  3641. leftfirst, leftlast, rightfirst, rightlast </emphasis><emphasis role="bold">)</emphasis></para>
  3642. <para><emphasis>leftfirst</emphasis> An integer value containing the
  3643. start date of a date range in YYYYMM format.</para>
  3644. <para><emphasis>leftlast</emphasis> An integer value containing the
  3645. end date of a date range in YYYYMM format.</para>
  3646. <para><emphasis>rightfirst</emphasis> An integer value containing the
  3647. start date of a date range in YYYYMM format.</para>
  3648. <para><emphasis>rightlast</emphasis> An integer value containing the
  3649. end date of a date range in YYYYMM format.</para>
  3650. <para>Return:<emphasis> </emphasis>Date_Overlap_First returns an
  3651. INTEGER value.</para>
  3652. <para>The <emphasis role="bold">Date_Overlap_Last </emphasis>function
  3653. returns the ending overlap date between the
  3654. <emphasis>leftfirst</emphasis> to <emphasis>leftlast</emphasis> and
  3655. <emphasis>rightfirst </emphasis>to <emphasis>rightlast </emphasis>date
  3656. ranges.</para>
  3657. <para>Example:</para>
  3658. <programlisting>Import LIB_Date;
  3659. A := LIB_Date.date_overlap_last(200001,200303,200201,200302);
  3660. //A contains 200302 -- the two ranges overlap from 200201 to 200302</programlisting>
  3661. </sect2>
  3662. <sect2 id="Date_YYYYMM_I2">
  3663. <title><emphasis role="bold">Date_YYYYMM_I2</emphasis></title>
  3664. <para><emphasis role="bold">LIB_Date.Date_YYYYMM_I2(</emphasis><emphasis> date
  3665. </emphasis><emphasis role="bold">)</emphasis></para>
  3666. <para><emphasis>date</emphasis> A 6-byte STRING value containing a
  3667. date in YYYYMM format.</para>
  3668. <para>Return:<emphasis> </emphasis>Date_YYYYMM_I2 returns an INTEGER
  3669. value.</para>
  3670. <para>The <emphasis role="bold">Date_I2_YYYYMM </emphasis>function
  3671. returns the <emphasis>date</emphasis> string translated into an
  3672. integer representing the number of months since 1900 (January, 1900 =
  3673. 1 while January 2001 = 1213).</para>
  3674. <para>Example:</para>
  3675. <programlisting>Import LIB_Date;
  3676. A := LIB_Date.Date_YYYYMM_I2('200101' );
  3677. //A contains 1213
  3678. B := LIB_Date.Date_YYYYMM_I2('190001' );
  3679. //B contains 1</programlisting>
  3680. </sect2>
  3681. <sect2 id="DayOfYear">
  3682. <title><emphasis role="bold">DayOfYear</emphasis></title>
  3683. <para><emphasis role="bold">LIB_Date.DayOfYear(</emphasis><emphasis>
  3684. year, month, day </emphasis><emphasis role="bold">)</emphasis></para>
  3685. <para><emphasis>year</emphasis> An integer value containing the
  3686. 4-digit year.</para>
  3687. <para><emphasis>month</emphasis> An integer value containing the month
  3688. number.</para>
  3689. <para><emphasis>day</emphasis> An integer value containing the day
  3690. number within the <emphasis>month</emphasis>.</para>
  3691. <para>Return:<emphasis> </emphasis>DayOfYear returns an INTEGER
  3692. value.</para>
  3693. <para>The <emphasis role="bold">DayOfYear </emphasis>function returns
  3694. the julian date for the date passed to it as the
  3695. <emphasis>year</emphasis>, <emphasis>month</emphasis>, and
  3696. <emphasis>day</emphasis> parameters. It does properly handle leap
  3697. years.</para>
  3698. <para>Example:</para>
  3699. <programlisting>Import LIB_Date;
  3700. A := LIB_Date.DayOfYear(2000,1,1 );
  3701. //A contains 1
  3702. B := LIB_Date.DayOfYear(2000,3,1 );
  3703. //B contains 61</programlisting>
  3704. </sect2>
  3705. <sect2 id="DaysApart">
  3706. <title><emphasis role="bold">DaysApart</emphasis></title>
  3707. <para><emphasis role="bold">LIB_Date.DaysApart(</emphasis><emphasis>
  3708. date1, date2 </emphasis><emphasis role="bold">)</emphasis></para>
  3709. <para><emphasis>date1</emphasis> An 8-byte STRING value containing a
  3710. date in YYYYMMDD format.</para>
  3711. <para><emphasis>date2</emphasis> An 8-byte STRING value containing a
  3712. date in YYYYMMDD format.</para>
  3713. <para>Return:<emphasis> </emphasis>DaysApart returns an INTEGER
  3714. value.</para>
  3715. <para>The <emphasis role="bold">DaysApart </emphasis>function returns
  3716. the number of days between <emphasis>date1 </emphasis>and
  3717. <emphasis>date2</emphasis>. It does properly handle leap years, but
  3718. only works with dates since 1900.</para>
  3719. <para>Example:</para>
  3720. <programlisting>Import LIB_Date;
  3721. A := LIB_Date.DaysApart('20030101' , '20030110' );
  3722. //A contains 9</programlisting>
  3723. </sect2>
  3724. <sect2 id="DaysSince1900">
  3725. <title><emphasis role="bold">DaysSince1900</emphasis></title>
  3726. <para><emphasis role="bold">LIB_Date.DaysSince1900(</emphasis><emphasis> year, month,
  3727. day </emphasis><emphasis role="bold">)</emphasis></para>
  3728. <para><emphasis>year</emphasis> An integer value containing the
  3729. 4-digit year.</para>
  3730. <para><emphasis>month</emphasis> An integer value containing the month
  3731. number.</para>
  3732. <para><emphasis>day</emphasis> An integer value containing the day
  3733. number within the <emphasis>month</emphasis>.</para>
  3734. <para>Return:<emphasis> </emphasis>DaysSince1900 returns an INTEGER
  3735. value.</para>
  3736. <para>The <emphasis role="bold">DaysSince1900 </emphasis>function
  3737. returns a julian-type date containng the number of days since 1/1/1900
  3738. and the date passed to it as the <emphasis>year</emphasis>,
  3739. <emphasis>month</emphasis>, and <emphasis>day</emphasis> parameters.
  3740. It does properly handle leap years.</para>
  3741. <para>Example:</para>
  3742. <programlisting>Import LIB_Date;
  3743. A := LIB_Date.DaysSince1900(2003,1,1);
  3744. //A contains 37621
  3745. B := LIB_Date.DaysSince1900(1900,1,1);
  3746. //B contains 1</programlisting>
  3747. </sect2>
  3748. <sect2 id="EarliestDate">
  3749. <title><emphasis role="bold">EarliestDate</emphasis></title>
  3750. <para><emphasis role="bold">LIB_Date.EarliestDate(</emphasis><emphasis> date1, date2
  3751. </emphasis><emphasis role="bold">)</emphasis></para>
  3752. <para><emphasis>date1</emphasis> An INTEGER value containing a
  3753. date.</para>
  3754. <para><emphasis>date2</emphasis> An INTEGER value containing a
  3755. date.</para>
  3756. <para>Return:<emphasis> </emphasis>EarliestDate returns an INTEGER
  3757. value.</para>
  3758. <para>The <emphasis role="bold">EarliestDate </emphasis>function
  3759. returns the earlier of the passed <emphasis>date1 </emphasis>and
  3760. <emphasis>date2 </emphasis>parameters. Both the <emphasis>date1
  3761. </emphasis>and <emphasis>date2 </emphasis>parameters should contain
  3762. values derived from similar processes.</para>
  3763. <para>Example:</para>
  3764. <programlisting>Import LIB_Date;
  3765. A := LIB_Date.EarliestDate(20030101 , 20030110 );
  3766. //A contains 20030101
  3767. B := LIB_Date.EarliestDate(LIB_Date.DaysSince1900(2003,1,1),
  3768. LIB_Date.DaysSince1900(2003,1,10) );
  3769. //B contains 37621
  3770. // (the return value from LIB_Date.DaysSince1900(2003,1,1))</programlisting>
  3771. </sect2>
  3772. <sect2 id="EarliestDateString">
  3773. <title><emphasis role="bold">EarliestDateString</emphasis></title>
  3774. <para><emphasis role="bold">LIB_Date.EarliestDateString(</emphasis><emphasis> date1,
  3775. date2 </emphasis><emphasis role="bold">)</emphasis></para>
  3776. <para><emphasis>date1</emphasis> An STRING value containing a
  3777. date.</para>
  3778. <para><emphasis>date2</emphasis> An STRING value containing a
  3779. date.</para>
  3780. <para>Return:<emphasis> </emphasis>EarliestDateString returns a STRING
  3781. value.</para>
  3782. <para>The <emphasis role="bold">EarliestDateString </emphasis>function
  3783. returns the earlier of the passed <emphasis>date1 </emphasis>and
  3784. <emphasis>date2 </emphasis>parameters. Both the <emphasis>date1
  3785. </emphasis>and <emphasis>date2 </emphasis>parameters should be in
  3786. YYYYMMDD or YYYYMM format for proper evaluation.</para>
  3787. <para>Example:</para>
  3788. <programlisting>Import LIB_Date;
  3789. A := LIB_Date.EarliestDateString('20030101' , '20030110' );
  3790. //A contains 20030101</programlisting>
  3791. </sect2>
  3792. <sect2 id="Format_Date">
  3793. <title><emphasis role="bold">Format_Date</emphasis></title>
  3794. <para><emphasis role="bold">LIB_Date.Format_Date(</emphasis><emphasis>
  3795. year, month, day </emphasis><emphasis role="bold">)</emphasis></para>
  3796. <para><emphasis>year</emphasis> An integer value containing the
  3797. 4-digit year.</para>
  3798. <para><emphasis>month</emphasis> An integer value containing the month
  3799. number.</para>
  3800. <para><emphasis>day</emphasis> An integer value containing the day
  3801. number within the <emphasis>month</emphasis>.</para>
  3802. <para>Return:<emphasis> </emphasis>FormatDate returns a STRING
  3803. value.</para>
  3804. <para>The <emphasis role="bold">Format_Date </emphasis>function
  3805. returns a date string in YYYY/MM/DD format.</para>
  3806. <para>Example:</para>
  3807. <programlisting>Import LIB_Date;
  3808. A := LIB_Date.Format_Date(2003,1,1);
  3809. //A contains “2003/01/01”</programlisting>
  3810. </sect2>
  3811. <sect2 id="GetAge">
  3812. <title><emphasis role="bold">GetAge</emphasis></title>
  3813. <para><emphasis role="bold">LIB_Date.GetAge(</emphasis><emphasis> date
  3814. </emphasis><emphasis role="bold">)</emphasis></para>
  3815. <para><emphasis>date</emphasis> An 8-byte STRING value containing a
  3816. date in YYYYMMDD format.</para>
  3817. <para>Return:<emphasis> </emphasis>GetAge returns an INTEGER
  3818. value.</para>
  3819. <para>The <emphasis role="bold">GetAge </emphasis>function returns the
  3820. number of years between the current system date and the passed
  3821. <emphasis>date</emphasis>.</para>
  3822. <para>Example:</para>
  3823. <programlisting>Import LIB_Date;
  3824. A := LIB_Date.GetAge('20000101' );
  3825. //A contains 3, assuming the current date is
  3826. // sometime within the 2003 calendar year</programlisting>
  3827. </sect2>
  3828. <sect2 id="LatestDate">
  3829. <title><emphasis role="bold">LatestDate</emphasis></title>
  3830. <para><emphasis role="bold">LIB_Date.LatestDate(</emphasis><emphasis>
  3831. date1, date2 </emphasis><emphasis role="bold">)</emphasis></para>
  3832. <para><emphasis>date1</emphasis> An INTEGER value containing a
  3833. date.</para>
  3834. <para><emphasis>date2</emphasis> An INTEGER value containing a
  3835. date.</para>
  3836. <para>Return:<emphasis> </emphasis>LatestDate returns an INTEGER
  3837. value.</para>
  3838. <para>The <emphasis role="bold">LatestDate </emphasis>function returns
  3839. the later of the passed <emphasis>date1 </emphasis>and <emphasis>date2
  3840. </emphasis>parameters. Both the <emphasis>date1 </emphasis>and
  3841. <emphasis>date2 </emphasis>parameters should contain values derived
  3842. from similar processes.</para>
  3843. <para>Example:</para>
  3844. <programlisting>Import LIB_Date;
  3845. A := LIB_Date.LatestDate(20030101 , 20030110 );
  3846. //A contains 20030110
  3847. B := LIB_Date.LatestDate(LIB_Date.DaysSince1900(2003,1,1),
  3848. LIB_Date.DaysSince1900(2003,1,10) );
  3849. //B contains 37630
  3850. // (the return value from LIB_Date.DaysSince1900(2003,1,10))</programlisting>
  3851. </sect2>
  3852. <sect2 id="LeapYear">
  3853. <title><emphasis role="bold">LeapYear</emphasis></title>
  3854. <para><emphasis role="bold">LIB_Date.LeapYear(</emphasis><emphasis>
  3855. year </emphasis><emphasis role="bold">)</emphasis></para>
  3856. <para><emphasis>year</emphasis> An integer value containing the
  3857. 4-digit year.</para>
  3858. <para>Return:<emphasis> </emphasis>LeapYear returns a BOOLEAN
  3859. value.</para>
  3860. <para>The <emphasis role="bold">LeapYear </emphasis>function returns
  3861. TRUE if the passed <emphasis>year </emphasis>parameter is a leap
  3862. year.</para>
  3863. <para>Example:</para>
  3864. <programlisting>Import LIB_Date;
  3865. A := LIB_Date.LeapYear(2000);
  3866. //A contains TRUE
  3867. B := LIB_Date.LeapYear(2001);
  3868. //B contains FALSE</programlisting>
  3869. </sect2>
  3870. </sect1>
  3871. <sect1 id="Auditing">
  3872. <title><emphasis>Auditing</emphasis></title>
  3873. <sect2 id="Audit">
  3874. <title><emphasis role="bold">Audit</emphasis></title>
  3875. <para><emphasis role="bold">AuditLib.Audit(</emphasis><emphasis> type,
  3876. message </emphasis><emphasis role="bold">)</emphasis></para>
  3877. <para><emphasis>type</emphasis> A string constant containing the type
  3878. of audit entry. Currently, only INFO is provided.</para>
  3879. <para><emphasis>message</emphasis> A string containing the audit entry
  3880. text.</para>
  3881. <para>Return:<emphasis> </emphasis>Audit returns a BOOLEAN value
  3882. indicating whether it was successful or not.</para>
  3883. <para>The <emphasis role="bold">Audit </emphasis>function writes the
  3884. <emphasis>message</emphasis> into the Windows event log or Linux
  3885. system log on the ECL Agent computer. The entries can be retrieved
  3886. from the logs using standard operating system tools.</para>
  3887. <para>Example:</para>
  3888. <programlisting>AuditLib.Audit('INFO','Audit Message');</programlisting>
  3889. </sect2>
  3890. <sect2 id="AuditData">
  3891. <title><emphasis role="bold">AuditData</emphasis></title>
  3892. <para><emphasis role="bold">AuditLib.Auditdata(</emphasis><emphasis>
  3893. type, message, datablock </emphasis><emphasis role="bold">)</emphasis></para>
  3894. <para><emphasis>type</emphasis> A string constant containing the type
  3895. of audit entry. Currently, only INFO is provided.</para>
  3896. <para><emphasis>message</emphasis> A string containing the audit entry
  3897. text.</para>
  3898. <para><emphasis>datablock</emphasis> An unstructured block of data,
  3899. which the application reading the log entry must know how to
  3900. read.</para>
  3901. <para>Return:<emphasis> </emphasis>AuditData returns a BOOLEAN value
  3902. indicating whether it was successful or not.</para>
  3903. <para>The <emphasis role="bold">AuditData </emphasis>function writes
  3904. the <emphasis>message</emphasis> into the Windows event log or Linux
  3905. system log on the ECL Agent computer. The entries can be retrieved
  3906. from the logs using standard operating system tools.</para>
  3907. <para>Example:</para>
  3908. <programlisting>DATA2 DataBlock := x'0D0A';
  3909. AuditLib.AuditData('INFO','Audit Message',DataBlock);</programlisting>
  3910. </sect2>
  3911. </sect1>
  3912. <sect1 id="Parsing_Support">
  3913. <title><emphasis>Parsing Support</emphasis></title>
  3914. <sect2 id="GetParseTree">
  3915. <title><emphasis role="bold">GetParseTree</emphasis></title>
  3916. <para><emphasis role="bold">ParseLib.GetParseTree(</emphasis><emphasis>
  3917. </emphasis><emphasis role="bold">)</emphasis></para>
  3918. <para>Return:<emphasis> </emphasis>GetParseTree returns a STRING
  3919. value.</para>
  3920. <para>The <emphasis role="bold">GetParseTree </emphasis>function
  3921. returns a textual representation of the match that occurred, using
  3922. square brackets (such as: a[b[c]d] ) to indicate nesting. This
  3923. function is only used within the RECORD or TRANSFORM structure that
  3924. defines the result of a PARSE operation. This function is useful for
  3925. debugging PARSE operations.</para>
  3926. <para>Example:</para>
  3927. <programlisting>r := {string150 line};
  3928. d := dataset([
  3929. {'Ge 34:2 And when Shechem the son of Hamor the Hivite, '+
  3930. 'prince of the country, saw her, he took her, and lay with her, '+
  3931. 'and defiled her.'},
  3932. {'Ge 36:10 These are the names of Esaus sons; Eliphaz the son of '+
  3933. 'Adah the wife of Esau, Reuel the son of Bashemath the wife of '+
  3934. 'Esau.'}
  3935. ],r);
  3936. PATTERN ws := [' ','\t',',']*;
  3937. PATTERN patStart := FIRST | ws;
  3938. PATTERN patEnd := LAST | ws;
  3939. PATTERN article := ['A','The','Thou','a','the','thou'];
  3940. TOKEN patWord := PATTERN('[a-zA-Z]+');
  3941. TOKEN Name := PATTERN('[A-Z][a-zA-Z]+');
  3942. RULE Namet := name OPT(ws 'the' ws name);
  3943. PATTERN produced_by := OPT(article ws) ['son of','daughter of'];
  3944. PATTERN produces_with := OPT(article ws) ['wife of'];
  3945. RULE progeny := namet ws ( produced_by | produces_with ) ws namet;
  3946. results := RECORD
  3947. STRING LeftName := MATCHTEXT(Namet[1]);
  3948. STRING RightName := MATCHTEXT(Namet[2]);
  3949. STRING LinkPhrase := IF(MATCHTEXT(produced_by[1])&lt;&gt;'',
  3950. MATCHTEXT(produced_by[1]),
  3951. MATCHTEXT(produces_with[1]));
  3952. STRING Tree := 'Tree: ' + parseLib.getParseTree();
  3953. END;
  3954. outfile1 := PARSE(d,line,progeny,results,SCAN ALL);
  3955. /* the Tree field output looks like this:
  3956. Tree: [namet[name"Shechem"] ws" " produced_by"the son of" ws" " namet[name"Hamor"]]
  3957. */</programlisting>
  3958. </sect2>
  3959. <sect2 id="GetXMLParseTree">
  3960. <title><emphasis role="bold">GetXMLParseTree</emphasis></title>
  3961. <para><emphasis role="bold">ParseLib.GetXMLParseTree(</emphasis><emphasis>
  3962. </emphasis><emphasis role="bold">)</emphasis></para>
  3963. <para>Return:<emphasis> </emphasis>GetXMLParseTree returns a STRING
  3964. value.</para>
  3965. <para>The <emphasis role="bold">GetXMLParseTree </emphasis>function
  3966. returns a textual representation of the match that occurred, using XML
  3967. tags to indicate nesting. This function is only used within the RECORD
  3968. or TRANSFORM structure that defines the result of a PARSE operation.
  3969. This function is useful for debugging PARSE operations.</para>
  3970. <para>Example:</para>
  3971. <programlisting>r := {string150 line};
  3972. d := dataset([
  3973. {'Ge 34:2 And when Shechem the son of Hamor the Hivite, '+
  3974. 'prince of the country, saw her, he took her, and lay with her, '+
  3975. 'and defiled her.'},
  3976. {'Ge 36:10 These are the names of Esaus sons; Eliphaz the son of '+
  3977. 'Adah the wife of Esau, Reuel the son of Bashemath the wife of '+
  3978. 'Esau.'}
  3979. ],r);
  3980. PATTERN ws := [' ','\t',',']*;
  3981. PATTERN patStart := FIRST | ws;
  3982. PATTERN patEnd := LAST | ws;
  3983. PATTERN article := ['A','The','Thou','a','the','thou'];
  3984. TOKEN patWord := PATTERN('[a-zA-Z]+');
  3985. TOKEN Name := PATTERN('[A-Z][a-zA-Z]+');
  3986. RULE Namet := name OPT(ws 'the' ws name);
  3987. PATTERN produced_by := OPT(article ws) ['son of','daughter of'];
  3988. PATTERN produces_with := OPT(article ws) ['wife of'];
  3989. RULE progeny := namet ws ( produced_by | produces_with ) ws namet;
  3990. results := RECORD
  3991. STRING LeftName := MATCHTEXT(Namet[1]);
  3992. STRING RightName := MATCHTEXT(Namet[2]);
  3993. STRING LinkPhrase := IF(MATCHTEXT(produced_by[1])&lt;&gt;'',
  3994. MATCHTEXT(produced_by[1]),
  3995. MATCHTEXT(produces_with[1]));
  3996. STRING Tree := 'Tree: ' + parseLib.getXMLParseTree();
  3997. END;
  3998. outfile1 := PARSE(d,line,progeny,results,SCAN ALL);
  3999. /* the Tree field output looks like this:
  4000. Tree: &lt;namet&gt;
  4001. &lt;name&gt;Shechem&lt;/name&gt;
  4002. &lt;/namet&gt;
  4003. &lt;ws&gt; &lt;/ws&gt;
  4004. &lt;produced_by&gt;the son of&lt;/produced_by&gt;
  4005. &lt;ws&gt; &lt;/ws&gt;
  4006. &lt;namet&gt;
  4007. &lt;name&gt;Hamor&lt;/name&gt;
  4008. &lt;/namet&gt;
  4009. */
  4010. </programlisting>
  4011. </sect2>
  4012. </sect1>
  4013. <sect1 id="Metaphone_Support">
  4014. <title><emphasis>Metaphone Support</emphasis></title>
  4015. <sect2 id="DMetaphone1">
  4016. <title><emphasis role="bold">DMetaphone1</emphasis></title>
  4017. <para><emphasis role="bold">MetaphoneLib.DMetaphone1(</emphasis><emphasis>
  4018. source</emphasis><emphasis role="bold"> )</emphasis></para>
  4019. <para><emphasis>source</emphasis> The string to process.</para>
  4020. <para>Return:<emphasis> </emphasis>DMetaphone1 returns a STRING
  4021. value.</para>
  4022. <para>The <emphasis role="bold">DMetaphone1 </emphasis>function
  4023. returns a textual representation of the <emphasis>source</emphasis>
  4024. data, similar to a soundex code. This function returns the first
  4025. return value from the Double Metaphone algorithm.</para>
  4026. <para>Example:</para>
  4027. <programlisting>r := RECORD
  4028. STRING source;
  4029. STRING M1;
  4030. STRING M2;
  4031. STRING Mboth;
  4032. END;
  4033. r XF(ProgGuide.Person.File L) := TRANSFORM
  4034. SELF.source := L.LastName;
  4035. SELF.M1 := MetaphoneLib.DMetaphone1( L.LastName );
  4036. SELF.M2 := MetaphoneLib.DMetaphone2( L.LastName );
  4037. SELF.Mboth := MetaphoneLib.DMetaphoneBoth( L.LastName );
  4038. END;
  4039. ds := PROJECT(ProgGuide.Person.File,XF(LEFT));
  4040. COUNT(ds);
  4041. COUNT(ds(M1 &lt;&gt; M2));
  4042. OUTPUT(ds);
  4043. OUTPUT(ds(M1 &lt;&gt; M2));
  4044. </programlisting>
  4045. </sect2>
  4046. <sect2 id="DMetaphone2">
  4047. <title><emphasis role="bold">DMetaphone2</emphasis></title>
  4048. <para><emphasis role="bold">MetaphoneLib.DMetaphone2(</emphasis><emphasis>
  4049. source</emphasis><emphasis role="bold"> )</emphasis></para>
  4050. <para><emphasis>source</emphasis> The string to process.</para>
  4051. <para>Return:<emphasis> </emphasis>DMetaphone2 returns a STRING
  4052. value.</para>
  4053. <para>The <emphasis role="bold">DMetaphone2 </emphasis>function
  4054. returns a textual representation of the <emphasis>source</emphasis>
  4055. data, similar to a soundex code. This function returns the second
  4056. return value from the Double Metaphone algorithm.</para>
  4057. <para>Example:</para>
  4058. <programlisting>r := RECORD
  4059. STRING source;
  4060. STRING M1;
  4061. STRING M2;
  4062. STRING Mboth;
  4063. END;
  4064. r XF(ProgGuide.Person.File L) := TRANSFORM
  4065. SELF.source := L.LastName;
  4066. SELF.M1 := MetaphoneLib.DMetaphone1( L.LastName );
  4067. SELF.M2 := MetaphoneLib.DMetaphone2( L.LastName );
  4068. SELF.Mboth := MetaphoneLib.DMetaphoneBoth( L.LastName );
  4069. END;
  4070. ds := PROJECT(ProgGuide.Person.File,XF(LEFT));
  4071. COUNT(ds);
  4072. COUNT(ds(M1 &lt;&gt; M2));
  4073. OUTPUT(ds);
  4074. OUTPUT(ds(M1 &lt;&gt; M2));</programlisting>
  4075. </sect2>
  4076. <sect2 id="DMetaphoneBoth">
  4077. <title><emphasis role="bold">DMetaphoneBoth</emphasis></title>
  4078. <para><emphasis role="bold">MetaphoneLib.DMetaphoneBoth(</emphasis><emphasis>
  4079. source</emphasis><emphasis role="bold"> )</emphasis></para>
  4080. <para><emphasis>source</emphasis> The string to process.</para>
  4081. <para>Return:<emphasis> </emphasis>DMetaphoneBoth returns a STRING
  4082. value.</para>
  4083. <para>The <emphasis role="bold">DMetaphoneBoth </emphasis>function
  4084. returns a textual representation of the <emphasis>source</emphasis>
  4085. data, similar to a soundex code. This function returns both return
  4086. value from the Double Metaphone algorithm, concatenating the two into
  4087. a single result string.</para>
  4088. <para>Example:</para>
  4089. <programlisting>r := RECORD
  4090. STRING source;
  4091. STRING M1;
  4092. STRING M2;
  4093. STRING Mboth;
  4094. END;
  4095. r XF(ProgGuide.Person.File L) := TRANSFORM
  4096. SELF.source := L.LastName;
  4097. SELF.M1 := MetaphoneLib.DMetaphone1( L.LastName );
  4098. SELF.M2 := MetaphoneLib.DMetaphone2( L.LastName );
  4099. SELF.Mboth := MetaphoneLib.DMetaphoneBoth( L.LastName );
  4100. END;
  4101. ds := PROJECT(ProgGuide.Person.File,XF(LEFT));
  4102. COUNT(ds);
  4103. COUNT(ds(M1 &lt;&gt; M2));
  4104. OUTPUT(ds);
  4105. OUTPUT(ds(M1 &lt;&gt; M2));</programlisting>
  4106. </sect2>
  4107. </sect1>
  4108. <sect1 id="Workunit_Services">
  4109. <title><emphasis>Workunit Services</emphasis></title>
  4110. <sect2 id="WorkunitList">
  4111. <title><emphasis role="bold">WorkunitList</emphasis></title>
  4112. <para><emphasis role="bold">WorkunitServices.WorkunitList(</emphasis><emphasis>
  4113. lowwuid </emphasis><emphasis role="bold">[</emphasis><emphasis>,
  4114. highwuid </emphasis><emphasis role="bold">] [</emphasis><emphasis>,
  4115. username </emphasis><emphasis role="bold">]</emphasis><emphasis role="bold"> [</emphasis><emphasis>, cluster </emphasis><emphasis role="bold">] [</emphasis><emphasis>, jobname </emphasis><emphasis role="bold">] [</emphasis><emphasis>, state </emphasis><emphasis role="bold">] [</emphasis><emphasis>, priority </emphasis><emphasis role="bold">]</emphasis><emphasis role="bold"> [</emphasis><emphasis>,
  4116. fileread </emphasis><emphasis role="bold">] [</emphasis><emphasis>,
  4117. filewritten </emphasis><emphasis role="bold">] [</emphasis><emphasis>,
  4118. roxiecluster </emphasis><emphasis role="bold">]</emphasis><emphasis role="bold"> [</emphasis><emphasis>, eclcontains </emphasis><emphasis role="bold">] [</emphasis><emphasis>, online </emphasis><emphasis role="bold">] [</emphasis><emphasis>, archived </emphasis><emphasis role="bold">])</emphasis></para>
  4119. <para><emphasis>lowwuid</emphasis> A null-terminated string containing
  4120. the lowest WorkUnit IDentifier to list. This may be an empty
  4121. string.</para>
  4122. <para><emphasis>highwuid</emphasis> Optional. A null-terminated string
  4123. containing the highest WorkUnit IDentifier to list. If omitted, the
  4124. default is an empty string.</para>
  4125. <para><emphasis>cluster</emphasis> Optional. A null-terminated string
  4126. containing the name of the cluster the workunit ran on. If omitted,
  4127. the default is an empty string.</para>
  4128. <para><emphasis>jobname</emphasis> Optional. A null-terminated string
  4129. containing the name of the workunit. This may contain wildcard ( * ? )
  4130. characters. If omitted, the default is an empty string.</para>
  4131. <para><emphasis>state</emphasis> Optional. A null-terminated string
  4132. containing the state of the workunit. If omitted, the default is an
  4133. empty string.</para>
  4134. <para><emphasis>priority</emphasis> Optional. A null-terminated string
  4135. containing the priority of the workunit. If omitted, the default is an
  4136. empty string.</para>
  4137. <para><emphasis>fileread</emphasis> Optional. A null-terminated string
  4138. containing the name of a file read by the workunit. This may contain
  4139. wildcard ( * ? ) characters. If omitted, the default is an empty
  4140. string.</para>
  4141. <para><emphasis>filewritten</emphasis> Optional. A null-terminated
  4142. string containing the name of a file written by the workunit. This may
  4143. contain wildcard ( * ? ) characters. If omitted, the default is an
  4144. empty string.</para>
  4145. <para><emphasis>roxiecluster</emphasis> Optional. A null-terminated
  4146. string containing the name of the Roxie cluster. If omitted, the
  4147. default is an empty string.</para>
  4148. <para><emphasis>eclcontains</emphasis> Optional. A null-terminated
  4149. string containing text to search for in the workunit’s ECL code. This
  4150. may contain wildcard ( * ? ) characters. If omitted, the default is an
  4151. empty string.</para>
  4152. <para><emphasis>online</emphasis> Optional. A Boolean true/false value
  4153. specifying whether the search is performed online. If omitted, the
  4154. default is TRUE.</para>
  4155. <para><emphasis>archived</emphasis> Optional. A Boolean true/false
  4156. value specifying whether the seacrh is performed in the archives. If
  4157. omitted, the default is FALSE.</para>
  4158. <para>Return:<emphasis> </emphasis>WorkunitList returns a
  4159. DATASET.</para>
  4160. <para>The <emphasis role="bold">WorkunitList </emphasis>function
  4161. returns a dataset of all workunits that meet the search criteria
  4162. specified by the parameters passed to the function. All the parameters
  4163. are search values and all but the first are omittable, therefore the
  4164. easiest way to pass a particular single search parameter would be to
  4165. use the NAMED parameter passing technique.</para>
  4166. <para>The resulting DATASET is in this format:</para>
  4167. <para>WorkunitRecord := RECORD</para>
  4168. <para>STRING24 wuid;</para>
  4169. <para>STRING owner{MAXLENGTH(64)};</para>
  4170. <para>STRING cluster{MAXLENGTH(64)};</para>
  4171. <para>STRING roxiecluster{MAXLENGTH(64)};</para>
  4172. <para>STRING job{MAXLENGTH(256)};</para>
  4173. <para>STRING10 state;</para>
  4174. <para>STRING7 priority;</para>
  4175. <para>STRING20 created;</para>
  4176. <para>STRING20 modified;</para>
  4177. <para>BOOLEAN online;</para>
  4178. <para>BOOLEAN protected;</para>
  4179. <para>END;</para>
  4180. <para>Example:</para>
  4181. <programlisting>OUTPUT(WorkunitServices.WorkunitList(''));
  4182. //list all current workunits
  4183. OUTPUT(WorkunitServices.WorkunitList('',
  4184. NAMED eclcontains := 'COUNT'));
  4185. //list only those where the ECL code contains the word 'COUNT'
  4186. //this search is case insensitive and does include comments</programlisting>
  4187. </sect2>
  4188. <sect2 id="WorkunitExists">
  4189. <title><emphasis role="bold">WorkunitExists</emphasis></title>
  4190. <para><emphasis role="bold">WorkunitServices.WorkunitExists(</emphasis><emphasis> wuid
  4191. </emphasis><emphasis role="bold">[</emphasis><emphasis>, online
  4192. </emphasis><emphasis role="bold">] [</emphasis><emphasis>, archived
  4193. </emphasis><emphasis role="bold">] )</emphasis></para>
  4194. <para><emphasis>wuid</emphasis> A null-terminated string containing
  4195. the WorkUnit IDentifier to locate.</para>
  4196. <para><emphasis>online</emphasis> Optional. A Boolean true/false value
  4197. specifying whether the search is performed online. If omitted, the
  4198. default is TRUE.</para>
  4199. <para><emphasis>archived</emphasis> Optional. A Boolean true/false
  4200. value specifying whether the seacrh is performed in the archives. If
  4201. omitted, the default is FALSE.</para>
  4202. <para>Return:<emphasis> </emphasis>WorkunitExists returns a BOOLEAN
  4203. value.</para>
  4204. <para>The <emphasis role="bold">WorkunitExists </emphasis>function
  4205. returns whether the <emphasis>wuid</emphasis> exists.</para>
  4206. <para>Example:</para>
  4207. <programlisting>OUTPUT(WorkunitServices.WorkunitExists('W20070308-164946'));</programlisting>
  4208. </sect2>
  4209. <sect2 id="WUIDonDate">
  4210. <title><emphasis role="bold">WUIDonDate</emphasis></title>
  4211. <para><emphasis role="bold">WorkunitServices.WUIDonDate(</emphasis><emphasis> year,
  4212. month, day, hour, minute </emphasis><emphasis role="bold">
  4213. )</emphasis></para>
  4214. <para><emphasis>year</emphasis> An unsigned integer containing the
  4215. year value.</para>
  4216. <para><emphasis>month</emphasis> An unsigned integer containing the
  4217. month value.</para>
  4218. <para><emphasis>day</emphasis> An unsigned integer containing the day
  4219. value.</para>
  4220. <para><emphasis>hour</emphasis> An unsigned integer containing the
  4221. hour value.</para>
  4222. <para><emphasis>minute</emphasis> An unsigned integer containing the
  4223. minute value.</para>
  4224. <para>Return:<emphasis> </emphasis>WUIDonDate returns a VARSTRING
  4225. value.</para>
  4226. <para>The <emphasis role="bold">WUIDonDate </emphasis>function returns
  4227. a valid WorkUnit IDentifier for a workunit that meets the passed
  4228. parameters.</para>
  4229. <para>Example:</para>
  4230. <programlisting>lowwuid := WorkunitServices.WUIDonDate(2008,02,13,13,00);
  4231. highwuid := WorkunitServices.WUIDonDate(2008,02,13,14,00);
  4232. OUTPUT(WorkunitServices.WorkunitList(lowwuid,highwuid));
  4233. //returns a list of workunits between 1 &amp; 2 PM on 2/13/08</programlisting>
  4234. </sect2>
  4235. <sect2 id="WUIDdaysAgos">
  4236. <title><emphasis role="bold">WUIDdaysAgos</emphasis></title>
  4237. <para><emphasis role="bold">WorkunitServices.WUIDdaysAgo(</emphasis><emphasis> daysago
  4238. </emphasis><emphasis role="bold"> )</emphasis></para>
  4239. <para><emphasis>daysago</emphasis> An unsigned integer containing the
  4240. number of days to go back.</para>
  4241. <para>Return:<emphasis> </emphasis>WUIDdaysAgo returns a VARSTRING
  4242. value.</para>
  4243. <para>The <emphasis role="bold">WUIDdaysAgo </emphasis>function
  4244. returns a valid WorkUnit IDentifier for a workunit that would have run
  4245. within the last <emphasis>daysago</emphasis> days.</para>
  4246. <para>Example:</para>
  4247. <programlisting>daysago := WorkunitServices.WUIDdaysAgo(3);
  4248. OUTPUT(WorkunitServices.WorkunitList(daysago));
  4249. //returns a list of workunits run in the last 72 hours</programlisting>
  4250. </sect2>
  4251. <sect2 id="WorkunitTimeStamps">
  4252. <title><emphasis role="bold">WorkunitTimeStamps</emphasis></title>
  4253. <para><emphasis role="bold">WorkunitServices.WorkunitTimeStamps(</emphasis><emphasis>
  4254. wuid </emphasis><emphasis role="bold">)</emphasis></para>
  4255. <para><emphasis>wuid</emphasis> A null-terminated string containing
  4256. the WorkUnit IDentifier.</para>
  4257. <para>Return:<emphasis> </emphasis>WorkunitTimeStamps returns a
  4258. DATASET value.</para>
  4259. <para>The <emphasis role="bold">WorkunitTimeStamps </emphasis>function
  4260. returns a DATASET with this format:</para>
  4261. <para>EXPORT WsTimeStamp := RECORD</para>
  4262. <para>STRING32 application;</para>
  4263. <para>STRING16 id;</para>
  4264. <para>STRING20 time;</para>
  4265. <para>STRING16 instance;</para>
  4266. <para>END;</para>
  4267. <para>Each record in the returned dataset specifies a step in the
  4268. workunit’s excution process (creation, compilation, etc.).</para>
  4269. <para>Example:</para>
  4270. <programlisting>OUTPUT(WorkunitServices.WorkunitTimeStamps('W20070308-164946'));
  4271. /* produces output like this:
  4272. 'workunit ','Created ','2008-02-13T18:28:20Z',' '
  4273. 'workunit ','Modified','2008-02-13T18:32:47Z',' '
  4274. 'EclServer ','Compiled','2008-02-13T18:28:20Z','10.173.9.2:0 '
  4275. 'EclAgent ','Started ','2008-02-13T18:32:35Z','training009003'
  4276. 'Thor - graph1','Finished','2008-02-13T18:32:47Z','training009004'
  4277. 'Thor - graph1','Started ','2008-02-13T18:32:13Z','training009004'
  4278. 'EclAgent ','Finished','2008-02-13T18:33:09Z','training009003'
  4279. */</programlisting>
  4280. </sect2>
  4281. <sect2 id="WorkunitMessages">
  4282. <title><emphasis role="bold">WorkunitMessages</emphasis></title>
  4283. <para><emphasis role="bold">WorkunitServices.WorkunitMessages(</emphasis><emphasis>
  4284. wuid </emphasis><emphasis role="bold">)</emphasis></para>
  4285. <para><emphasis>wuid</emphasis> A null-terminated string containing
  4286. the WorkUnit IDentifier.</para>
  4287. <para>Return:<emphasis> </emphasis>WorkunitMessages returns a DATASET
  4288. value.</para>
  4289. <para>The <emphasis role="bold">WorkunitMessages </emphasis>function
  4290. returns a DATASET with this format:</para>
  4291. <para>EXPORT WsMessage := RECORD</para>
  4292. <para>UNSIGNED4 severity;</para>
  4293. <para>INTEGER4 code;</para>
  4294. <para>STRING32 location;</para>
  4295. <para>UNSIGNED4 row;</para>
  4296. <para>UNSIGNED4 col;</para>
  4297. <para>STRING16 source;</para>
  4298. <para>STRING20 time;</para>
  4299. <para>STRING message{MAXLENGTH(1024)};</para>
  4300. <para>END;</para>
  4301. <para>Each record in the returned dataset specifies a message in the
  4302. workunit.</para>
  4303. <para>Example:</para>
  4304. <programlisting>OUTPUT(WorkunitServices.WorkunitMessages('W20070308-164946'));</programlisting>
  4305. </sect2>
  4306. <sect2 id="WorkunitFilesRead">
  4307. <title><emphasis role="bold">WorkunitFilesRead</emphasis></title>
  4308. <para><emphasis role="bold">WorkunitServices.WorkunitFilesRead(</emphasis><emphasis>
  4309. wuid </emphasis><emphasis role="bold">)</emphasis></para>
  4310. <para><emphasis>wuid</emphasis> A null-terminated string containing
  4311. the WorkUnit IDentifier.</para>
  4312. <para>Return:<emphasis> </emphasis>WorkunitFilesRead returns a DATASET
  4313. value.</para>
  4314. <para>The <emphasis role="bold">WorkunitFilesRead </emphasis>function
  4315. returns a DATASET with this format:</para>
  4316. <para>EXPORT WsFileRead := RECORD</para>
  4317. <para>STRING name{MAXLENGTH(256)};</para>
  4318. <para>STRING cluster{MAXLENGTH(64)};</para>
  4319. <para>BOOLEAN isSuper;</para>
  4320. <para>UNSIGNED4 usage;</para>
  4321. <para>END;</para>
  4322. <para>Each record in the returned dataset specifies a file read by the
  4323. workunit.</para>
  4324. <para>Example:</para>
  4325. <programlisting>OUTPUT(WorkunitServices.WorkunitFilesRead('W20070308-164946'));
  4326. /* produces results that look like this
  4327. 'rttest::difftest::superfile','thor','true','1'
  4328. 'rttest::difftest::base1','thor','false','1'
  4329. */</programlisting>
  4330. </sect2>
  4331. <sect2 id="WorkunitFilesWritten">
  4332. <title><emphasis role="bold">WorkunitFilesWritten</emphasis></title>
  4333. <para><emphasis role="bold">WorkunitServices.WorkunitFilesWritten(</emphasis><emphasis>
  4334. wuid </emphasis><emphasis role="bold">)</emphasis></para>
  4335. <para><emphasis>wuid</emphasis> A null-terminated string containing
  4336. the WorkUnit IDentifier.</para>
  4337. <para>Return:<emphasis> </emphasis>WorkunitFilesWritten returns a
  4338. DATASET value.</para>
  4339. <para>The <emphasis role="bold">WorkunitFilesWritten
  4340. </emphasis>function returns a DATASET with this format:</para>
  4341. <para>EXPORT WsFileRead := RECORD</para>
  4342. <para>STRING name{MAXLENGTH(256)};</para>
  4343. <para>STRING10 graph;</para>
  4344. <para>STRING cluster{MAXLENGTH(64)};</para>
  4345. <para>UNSIGNED4 kind;</para>
  4346. <para>END;</para>
  4347. <para>Each record in the returned dataset specifies a file written by
  4348. the workunit.</para>
  4349. <para>Example:</para>
  4350. <programlisting>OUTPUT(WorkunitServices.WorkunitFilesWritten('W20070308-164946'));
  4351. /* produces results that look like this
  4352. 'rttest::testfetch','graph1','thor','0'
  4353. */</programlisting>
  4354. </sect2>
  4355. <sect2 id="WorkunitTimings">
  4356. <title><emphasis role="bold">WorkunitTimings</emphasis></title>
  4357. <para><emphasis role="bold">WorkunitServices.WorkunitTimings(</emphasis><emphasis>
  4358. wuid </emphasis><emphasis role="bold">)</emphasis></para>
  4359. <para><emphasis>wuid</emphasis> A null-terminated string containing
  4360. the WorkUnit IDentifier.</para>
  4361. <para>Return:<emphasis> </emphasis>WorkunitTimings returns a DATASET
  4362. value.</para>
  4363. <para>The <emphasis role="bold">WorkunitTimings </emphasis>function
  4364. returns a DATASET with this format:</para>
  4365. <para>EXPORT WsTiming := RECORD</para>
  4366. <para>UNSIGNED4 count;</para>
  4367. <para>UNSIGNED4 duration;</para>
  4368. <para>UNSIGNED4 max;</para>
  4369. <para>STRING name{MAXLENGTH(64)};</para>
  4370. <para>END;</para>
  4371. <para>Each record in the returned dataset specifies a timing for the
  4372. workunit.</para>
  4373. <para>Example:</para>
  4374. <programlisting>OUTPUT(WorkunitServices.WorkunitTimings('W20070308-164946'));
  4375. /* produces results that look like this
  4376. '1','4','4','EclServer: tree transform'
  4377. '1','0','0','EclServer: tree transform: normalize.scope'
  4378. '1','1','1','EclServer: tree transform: normalize.initial'
  4379. '1','18','18','EclServer: write c++'
  4380. '1','40','40','EclServer: generate code'
  4381. '1','1010','1010','EclServer: compile code'
  4382. '1','33288','33288','Graph graph1 - 1 (1)'
  4383. '1','33629','33629','Total thor time: '
  4384. '2','1','698000','WorkUnit_lockRemote'
  4385. '1','2','2679000','SDS_Initialize'
  4386. '1','0','439000','Environment_Initialize'
  4387. '1','33775','3710788928','Process'
  4388. '1','1','1942000','WorkUnit_unlockRemote'
  4389. */</programlisting>
  4390. </sect2>
  4391. </sect1>
  4392. </chapter>
  4393. </book>