Chapter Contents

Previous

Next
DMYTECHC

DMYTECHC



Calculates the character count for a DataMyte packet

Windows specifics: all


Syntax
Details
See Also

Syntax

DMYTECHC ('string')

string
specifies a text string.


Details

The DMYTECHC function accepts a text string as an argument and returns the character count for that string. This count represents the number of characters in the packet, excluding the STX (start-of-transmission) character, the character count itself, and the checksum. The return value is a 2-byte, hexadecimal number.

The following example of using the DMYTECHC function also uses the DMYTECKS CALL routine, which is described later in this chapter.

data dmyte1;
   length cs calccs $2;
   cs='00'x;
   /* This is the start-of-transmission character */
   stx='02'x;
   /* This is the end-of-transmission character   */
   eot='04'x;
   /* The character count includes the text       */
   /* string and the EOT.                         */
   cmd='?SETUP'||eot;
   cc=dmytechc(cmd);
   put cc=;
   str=stx||cc||cmd;
   /* Call DMYTECKS to determine the checksum     */
   /* (CALCCS) for the packet.                    */
   call dmytecks(str,cs,calccs);
   put calccs=;
   dmytecmd=str||calccs;
run;

Next, you would send the value of the DMYTECMD variable to the DataMyte machine via the communications port.

See Also


Chapter Contents

Previous

Next

Top of Page

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