operator increment, with presence bit in pmap set to 0

Imported from previous forum

Hi folks,

I’m a newbie to the wonderful world of FAST. Am I right to interpret the following instruction in the template file

13     <uInt32 name=“RptSeq” id=“83”><increment /></uInt32>

as a field that requires a bit to be set in the presence map regardless of whether the field is mandatory or optional?
If my interpretation is correct, then what happens if the bit in the pmap is 0? Does this mean there is no data in the stream?
And if so, what would be the incremental value of this field?

Below I provide more details. First are the 39 raw bytes (a), which are followed by the entire template file (b),
and finally my attempt decoding the stream by hand ©

Any help is greatly appreciated.

(a) raw bytes: (number of bytes = 39)
c0 bf 1a 55 41 d2 23 57 7b 45 07 1b 0a e3 09 4a 1a 8b 81 df 81 07 66 0f b7 80 83 5f 78 2a e8 86 80 23 cc 84 0b 0e 98

(b) the template

 1 <template name="MDIncRefresh_63" id="63" dictionary="63" xmlns="http://www.fixprotocol.org/ns/fast/td/1.1">
 2   <string name="MessageType" id="35"><constant value="X" /></string>
 3   <string name="ApplVerID" id="1128"><constant value="8" /></string>
 4   <string name="SenderCompID" id="49"><constant value="CME" /></string>
 5   <uInt32 name="MsgSeqNum" id="34"></uInt32>
 6   <string name="PosDupFlag" id="43" presence="optional"><default /></string>
 7   <uInt64 name="SendingTime" id="52"></uInt64>
 8   <uInt32 name="TradeDate" id="75"></uInt32>
 9   <sequence name="MDEntries">
10     <length name="NoMDEntries" id="268"></length>
11     <uInt32 name="MDUpdateAction" id="279"><copy value="0" /></uInt32>
12     <string name="MDEntryType" id="269"><copy value="0" /></string>
13     <uInt32 name="RptSeq" id="83"><increment /></uInt32>
14     <string name="QuoteCondition" id="276" presence="optional"><copy value="K" /></string>
15     <uInt32 name="MDPriceLevel" id="1023"><copy value="1" /></uInt32>
16     <uInt32 name="MDEntryTime" id="273"><copy value="0" /></uInt32>
17     <int32 name="MDEntrySize" id="271"><delta /></int32>
18     <decimal name="MDEntryPx" id="270">
19       <exponent><default value="-7" /></exponent>
20       <mantissa><delta /></mantissa>
21     </decimal>
22     <uInt32 name="NumberOfOrders" id="346" presence="optional"><delta /></uInt32>
23     <uInt32 name="SecurityID" id="48"><delta /></uInt32>
24     <uInt32 name="SecurityIDSource" id="22"><constant value="8" /></uInt32>
25     <string name="TradingSessionID" id="336"><default value="2" /></string>
26   </sequence>
27 </template>

© my attempt to decode the 39 bytes as best as I could

msg begin c0 - pmap 100 0000 bf - template_id = 63 line 2,3,4 - constant fields, they won't be in the stream 1a 55 41 d2 23 57 7b 45 07 1b 0a e3 - SendingTime on line 7, decoded value=20090123201201507 09 4a 1a 8b - tradeDate on line 8, decoded value=20090123 81 length on line 10, decoded uInt32 value=1 line 11 - the Copy operator requires pmap bit, regardless of optionality, but the bit in the pmap is 0 so no data in stream, value=0 line 12 - the same as line 11: no data in stream, value=0 line 13 - increment operator makes pmap bit a requirement regardless of field optionality, but i don't see any positive bit in pmap,           meaning no data in stream? how do I decode/consume the next 12 bytes? df 81 07 66 0f b7 80 83 5f 78 2a e8 - this is where I got lost... but I labored on...    the rest are my guesses, but they seem to agree withe the values sent by CME 86 - MDEntrySize on line 17, decoded int value=6 80 - exponent on line 19, decoded int value=0 23 cc 84 - mantissa on line 20, decoded int value=4556 0b 0e 98 - SecurityID on line 23, decoded uInt32 value=182040 msg end

Default(not specified), fields have mandatory property in templates. In your case, the increment operator should occupy a PMAP slot. And if that slot has been set off, the field value should be calculated depending on the state of the previous value. You can check specification section 6.3.6 and section 10.5.1 for more detail. Hope that will be helpful.

/Bing

Hi folks,

I’m a newbie to the wonderful world of FAST. Am I right to interpret the
following instruction in the template file 13����� as a field that
requires a bit to be set in the presence map regardless of whether the
field is mandatory or optional? If my interpretation is correct, then
what happens if the bit in the pmap is 0? Does this mean there is no
data in the stream? And if so, what would be the incremental value of
this field?

Below I provide more details. First are the 39 raw bytes (a), which are
followed by the entire template file (b), and finally my attempt
decoding the stream by hand (c)

Any help is greatly appreciated.

(a) raw bytes: (number of bytes = 39) c0 bf 1a 55 41 d2 23 57 7b 45 07
1b 0a e3 09 4a 1a 8b 81 df 81 07 66 0f b7 80 83 5f 78 2a e8 86 80 23 cc
84 0b 0e 98

(b) the template �1�
�2��� �3��� �4��� �5��� �6��� �7��� �8��� �9��� 10����� 11�����
12����� 13����� 14����� 15�����
16����� 17����� 18�����
19�������
20������� 21�����
22����� 23����� 24�����
25����� 26��� 27�

(c) my attempt to decode the 39 bytes as best as I could

msg begin c0 - pmap 100 0000 bf - template_id = 63 line 2,3,4 -
constant fields, they won’t be in the stream 1a 55 41 d2 23 57 7b 45 07
1b 0a e3 - SendingTime on line 7, decoded value=20090123201201507 09 4a
1a 8b - tradeDate on line 8, decoded value=20090123 81 length on line
10, decoded uInt32 value=1 line 11 - the Copy operator requires pmap
bit, regardless of optionality, but the bit in the pmap is 0 so no data
in stream, value=0 line 12 - the same as line 11: no data in stream,
value=0 line 13 - increment operator makes pmap bit a requirement
regardless of field optionality, but i don’t see any positive bit in
pmap, ����������meaning no data in stream? how do I decode/consume the
next 12 bytes? df 81 07 66 0f b7 80 83 5f 78 2a e8 - this is where I got
lost… but I labored on… ���the rest are my guesses, but they seem to
agree withe the values sent by CME 86 - MDEntrySize on line 17, decoded
int value=6 80 - exponent on line 19, decoded int value=0 23 cc 84 -
mantissa on line 20, decoded int value=4556 0b 0e 98 - SecurityID on
line 23, decoded uInt32 value=182040 msg end

Hi gu gang,

When you’re learning how FAST encoding works, there is no substitute for reading and understanding the standard; however, once you understand it, this cheat-sheet may come in handy as a reference:

http://code.google.com/p/quickfast/wiki/FastFieldRules

To take one of your examples:

Find the row that starts Increment Mandatory
Reading across that row you can see that it uses a pmap bit. If the bit is zero then there is no value in the stream and the result is the dictionary + 1; if the pmap bit is one then the value comes from the stream.

Hope this helps,

Dale Wilson
Principal Software Engineer
Object Computing, Inc.