Chapter Contents

Previous

Next
DMYTERVC

DMYTERVC



Converts the DataMyte character count to an ASCII number

Windows specifics: all


Syntax
Details
See Also

Syntax

DMYTERVC (hex-number)

hex-number
specifies the 2-byte DataMyte character count in hexadecimal that is to be converted to anASCII number.


Details

The DMYTERVC functions helps you convert a DataMyte character count, which is a 2-byte hexadecimal number, to an ASCII number. This number represents the number of characters that DataMyte is transmitting. this number does not include the STX (start-of-transmission) character, the 2-byte character count characters, or the 2-byte checksum.

In the following example, the DMYTERVC function calculates the character count. Once the character count is know, it can be used to process the incoming data, such as separating the data into words and store those words in SAS variables.

data dmyte3;
   /* this is the start-of-transmission character       */
   stx='02'x;
   infile 'com1:' lrecl=1 recfm=f;
   input x $char1.;
   if x eq stx then
     do;
      input cc $char2.;
      datacnt=dmytervc(cc);
     end;
   /* The character count tells us how many characters  */
   /* are in the packet being sent from the data        */
   /* collector (DATANCT is number of characters        */
   /* calculated by the DMYTERVC function.              */
   do i = 1 to datacnt;
     index+1;
     input x $char1.;
     substr(str,index,1)=x;
   /* ...more data processing statements                */
   end;
run;

Some type of data you could expect in the packet include the data and time, identification information such as the name of the operator, and data values.

See Also


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.