One solution is to create fake small caps. The MWE below defines a command \fakesc that uppercases and shrinks text to resemble small caps.
\documentclass[a4paper,12pt,twoside]{memoir}
\usepackage{DejaVuSerifCondensed}
\usepackage[T1]{fontenc}
\newcommand\fakesc[1]{\uppercase{{\scriptsize #1}}}
\begin{document}
The sign on the door said \fakesc{keep out}, so we left.
\end{document}
Output:

Here is a second, more complex solution that applies the fake small caps effect only to the lowercase letters in the input string. This permits the input string to be a mixture of uppercase and lowercase letters, and only the lowercase letters will transformed into fake small caps. See MWE below.
\documentclass[a4paper,12pt,twoside]{memoir}
\usepackage{DejaVuSerifCondensed}
\usepackage[T1]{fontenc}
\usepackage{xstring} % needed for IfEqCase
\usepackage{forloop}
\newcounter{sccounter}
\newcounter{tempStringLength}
\newcommand{\betterfakesc}[1]{%
% this \betterfakesc command requires these two packages:
% xstring
% forloop
%
% First, we obtain the length of the input string.
\StrLen{#1}[\stringLength]%
%
% Our main forloop will be using a condition of “while less than \stringLength”,
% so we’ll need to increase \stringLength by 1 so the forloop will be able to iterate
% over the entire string. we’ll use a temporary counter tempStringLength to make
% this increase. That’s what the next three lines are about.
\setcounter{tempStringLength}{\stringLength}%
\addtocounter{tempStringLength}{1}%
\def\stringLength{\arabic{tempStringLength}}%
%
% Here is our main loop. We iterate over the characters in the input string,
% and the currentLetter is compared to the case rules we have defined. Basically
% if the currentLetter is any of the lowercase a-z letters, then we apply a
% “fake small caps” effect to it and output it.
\forloop[1]{sccounter}{1}{\value{sccounter}<\stringLength}{%
\StrChar{#1}{\value{sccounter}}[\currentLetter]%
%
\IfEqCase*{\currentLetter}{%
% The lines below are the rules. Obviously more could be added.
{a}{{\uppercase{\scriptsize a}}}%
{b}{{\uppercase{\scriptsize b}}}%
{c}{{\uppercase{\scriptsize c}}}%
{d}{{\uppercase{\scriptsize d}}}%
{e}{{\uppercase{\scriptsize e}}}%
{f}{{\uppercase{\scriptsize f}}}%
{g}{{\uppercase{\scriptsize g}}}%
{h}{{\uppercase{\scriptsize h}}}%
{i}{{\uppercase{\scriptsize i}}}%
{j}{{\uppercase{\scriptsize j}}}%
{k}{{\uppercase{\scriptsize k}}}%
{l}{{\uppercase{\scriptsize l}}}%
{m}{{\uppercase{\scriptsize m}}}%
{n}{{\uppercase{\scriptsize n}}}%
{o}{{\uppercase{\scriptsize o}}}%
{p}{{\uppercase{\scriptsize p}}}%
{q}{{\uppercase{\scriptsize q}}}%
{r}{{\uppercase{\scriptsize r}}}%
{s}{{\uppercase{\scriptsize s}}}%
{t}{{\uppercase{\scriptsize t}}}%
{u}{{\uppercase{\scriptsize u}}}%
{v}{{\uppercase{\scriptsize v}}}%
{w}{{\uppercase{\scriptsize w}}}%
{x}{{\uppercase{\scriptsize x}}}%
{y}{{\uppercase{\scriptsize y}}}%
{z}{{\uppercase{\scriptsize z}}}%
}%
% if our \currentLetter isn’t any of the letters we have rules for,
% then just output it now
[{\currentLetter}]%
}%
}
\begin{document}
The sign on the door said \betterfakesc{Keep Out}, so we left.
\end{document}
Output:

Note that additional rules could easily be added to the IfEqCase structure to handle punctuation, etc. (Also note that this command could even be repurposed for other types of textual or formatting transformations.)
Be aware that typography purists will complain that faking small caps by reducing font size will produce letter forms that are lighter in stroke weight than real small caps, and they're correct about that. The main advantage of fake small caps is that they work in any font and they're an easy solution to implement.
K\fakesc{eep} O\fakesc{ut}, and that is a good answer, however, as I commented in the question, I am actually trying to obtain small caps for a header and I am calling\leftmarkso I can obtain the chapter name and number, in that case, LaTeX won't render the small caps as I want it to do it. – Hans Aug 22 '15 at 14:04Ñor characterá,é,í,üor all the characters that I could use then I wouldn't have a desired output. – Hans Aug 22 '15 at 23:40{á}{{\uppercase{\scriptsize á}}}%
{é}{{\uppercase{\scriptsize é}}}%
{í}{{\uppercase{\scriptsize í}}}%
{ö}{{\uppercase{\scriptsize ö}}}%
{ü}{{\uppercase{\scriptsize ü}}}%
{ñ}{{\uppercase{\scriptsize ñ}}}%
– Tim Stewart Aug 23 '15 at 03:11indexbecause that easily leads to conflicts with other packages. For example, themakeidxpackage for creating an index throws a cryptic error message when your code is used in the same document as its\printidxcommand, presumably because it also uses a counter with the nameindex. If I replaceindexin your solution with something else (e.g.,scindex), it works well. – Philip Leifeld Dec 06 '15 at 18:28\betterfakescseems to produce infinite loop when used in math mode – BallpointBen Feb 01 '24 at 21:35