binary taq imbalances

Does anyone have any exprerience converting the nyse taq imbalance binary files?  I am using tq.q to convert taqquote, taqtrade and taqnbbo files, but I cant seem to get tq.q to run through the imbalance files. 

I have added 

/ imb fields (types;widths) trf after 200609if:seqtypetimesymssidescalerefpricenumimbqtypairedqtysourcetimeit:("IIISSSIIIII ";4 2 4 6 4 1 1 4 4 4 4)`

and 

\t foo[nyseimbalance;if;it] each F where F like"imbalance*[0-9]"`

but when I run it I just get `0 returned as if it cant find any files.  

Don’t try to have a variable called “if”

Thats true Attila, I did change that.  I still get the same error though.  Its like it cant find any imbalance[0-9] files.  I check the folder with key :/taq and they are definitely there, and I am doing the exact same thing as the taqtrade, taqquote, and taqnbbo files.

F is a function taking the string with the pattern for the files already
can you try

F”imbalance*[0-9]"

F:key src:`$":",.z.x 0

How are you loading the script? What are the values of .z.x once you load it?

I think you are missing the g function equivalent from your foo call.  Can you try:

\t foo[`nyseimbalance;if;it;{x}] each F where F like"imbalance*[0-9]"

Himanshu I am loading my scripting via a .bat file

start /affinity 1 c:\q\w32\q.exe c:\q\taqImb.q c:/imbalances c:/test/hdb -g 1

Conor I am missing a a g function call and I think that may be the problem.  I am not sure what to use as my g call because I dont need to use it.  I have tried just passing in g[] but gives a length error.  Here is the entire script

F:key src:$“:”,.z.x 0D:“I”$-8#string first F/ trade fields (types;widths) trf after 200609tf:timeexsymscondsizepricestopcorrseqctstrftt:("TCSSIFBIJCC ";9 1 6 10 4 9 11 1 2 16 1 1,1+20060930<D)/ imb fields (types;widths) trf after 200609imb:seqtypetimesymssidescalerefpricenumimbqtypairedqtysourcetimeimbt:("IIISSSIIIII ";4 2 4 6 4 1 1 4 4 4 4)/ quote fields (types;widths)qf:timeexsymsbidbsizeaskasizecondmmidbexaexseqbboqbbocorrcqs /rpi /ssrl0l1mpid/sipbboluldqt:("TCSSFIFIC*CCJCCCC ";9 1 6 10 11 7 11 7 1 4 1 1 16 1 1 1 1,2+(20120731<D)+(4*20130201<D)+2*20131202<D)/ nbbo fields (types;widths)nf:timeexsymsbidbsizeaskasizecondmmidbexaexseqbboqbbocorrcqsqcondbbexbbpricebbsizebbmmidbbmmlocbbmmdesklocbaexbapricebasizebammidbammlocbammdeskloc /l0l1sipnt:("TCSSFIFICCCJCCCCCCFISCCFISC “;9 1 6 10 11 7 11 7 1 4 1 1 16 1 1 1 1 1 1 11 7 4 2 1 1 11 7 4 2 1,2+(220130201<D)+120131202<D) / sym[.s] “e”$pricebidask g:{[f;x]symtime xcols delete s from @[;sym;{$[null y;x; sv x,y]}';xs]@[x;f;"e"$%;1e4]}foo:{[d;f;t;g;x]@[;sym;p#].Q.dsftg[(dst;"D"$-8#string x;d);( sv src,x;sum t 1;0);f;t;g]}\t foo[nyseimbalance;imb;imbt;g[] ] each F where F like"imbalance*[0-9]”`