How do I create the following rectangular symbol?

I don't fully understand your question, what symbol are you talking about? Here I've addressed your questions, if the size does not suit your need simply scale or re-size the objects:

  1. \draw (0,0) rectangle (1,2);
  2. \draw [->] (1,1)--+(1,0);
  3. Empty node is bad practice, rather use \coordinate (name) at (1,1); that leads to \draw [->] (name)--+(1,0);
  4. Using the library arrows.meta (have a look at this link) you can scale the size of the arrow in this way \draw [-{>[scale=0.7]}] (name)--+(1,0);

It could be useful to define a pic that allows you to place a predefined shape like a "stamp". I've defined a pic named mybox:

\documentclass[tikz,convert]{standalone}
\usetikzlibrary{arrows.meta}
\tikzset{mybox/.pic={
\draw (-0.5,-1) rectangle (.5,1);
\draw [-{>[scale=0.5]}] (0.5,0)--+(0.5,0);
}
}
\begin{document}
\begin{tikzpicture}[>=Stealth]
\pic at (0,0) {mybox};
\draw (1,1) arc (135:45:3) pic [red,pos=0.3,scale=0.5,sloped] {mybox}; 
\end{tikzpicture}
\end{document}

The result would be: mybox pic and its usage


Perhaps like this...

\documentclass[varwidth,border=5]{standalone}
\usepackage{tikz}
\def\abx{\tikz[x=0.75em,y=0.75em,baseline=0]\fill[even odd rule]
(0,0)--(.5,0)--(.5,.45)--(.75,.45)--(.75,.25)--(1,.5)--(.75,.75)--
(.75,.55)--(.5,.55)--(.5,1)--(0,1)--cycle(.1,.1)rectangle(.4,.9);}
\hbadness=10000
\begin{document}
\foreach \f in {\scriptsize,\footnotesize,\small,\normalsize,\large,\huge}{%
\noindent\hbox to1.125in{\texttt{\expandafter\string\f:}} 
\f xX \abx\ yY \\[.5ex]}
\end{document}

enter image description here


I'm not sure why you wish to use TikZ for this. However, since you do, here is one way you might go about it:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\newcounter{mybox}
\newlength\myboxminheight
\settoheight\myboxminheight{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\tikzset{%
  pics/my box/.style={%
    code={%
      \stepcounter{mybox}%
      \tikzset{%
        >/.tip={Triangle[length=2.5pt,width=2.5pt]},
        outer sep=0pt,
        every node/.append style={draw},
        make my box/.cd,
        #1,
        /tikz/.cd,
        make my box/my box look,
      }
      \node (box\themybox) [make my box/my box look, label=above:{\myboxlabel}, inner sep=\myboxisep, minimum height=\myboxminht-\myboxlinewidth, minimum width=.5*\myboxminht-.5*\myboxlinewidth] at (0,0) {};
      \draw [->, make my box/my box look, line width=\myboxlinewidth,] (box\themybox.east) -- +(\myboxextarrow,0);
    }
  },
  make my box/.search also={/tikz},
  make my box/.cd,
  line width/.store in=\myboxlinewidth,
  minimum height/.store in=\myboxminht,
  inner sep/.store in=\myboxisep,
  label/.store in=\myboxlabel,
  extend arrow/.store in=\myboxextarrow,
  look/.code={\tikzset{make my box/my box look/.append style={#1}}},
  line width=.35mm,
  minimum height=\myboxminheight,
  inner sep=0pt,
  label={},
  extend arrow=5pt,
  my box look/.style={draw, line width=\myboxlinewidth},
}
\newcommand\mybox[1][]{%
  \tikz{\pic {my box={#1}};}}
\begin{document}
  X \mybox{} \mybox[label={My Box}] \mybox[look={text=red, draw=blue}, extend arrow=25pt, minimum height=20pt, inner sep=2mm, line width=2.5pt, label={My Other Box}, >/.tip={Stealth[]}]
\end{document}

arrows

Note that the box of a glyph may include space above the drawn letter and that not all capital letters look of equal height close up. Hence, you'll need to tweak this according to your preferences, font configuration and needs.