% This is a solution to one of the exercises accompanying "LaTeX for Administrative Work"
% See www.dickimaw-books.com/latex/admin/ for the book details,
% including licence.
%
% arara: pdflatex
\documentclass[captions=tableabove]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{datatool}

\begin{document}

\newcommand*{\mylistI}{A,B,C,D}
\newcommand*{\mylistII}{a,b,c,d}

\renewcommand*{\do}[1]{& #1}

\begin{tabular}{lcccc}
\bfseries List 1: 
\expandafter\docsvlist\expandafter{\mylistI}\\
\bfseries List 2: 
\expandafter\docsvlist\expandafter{\mylistII}
\end{tabular}

Make third item empty.

\renewcommand*{\mylistII}{a,b,,d}

\begin{tabular}{lcccc}
\bfseries List 1: 
\expandafter\docsvlist\expandafter{\mylistI}\\
\bfseries List 2: 
\expandafter\docsvlist\expandafter{\mylistII}
\end{tabular}

\newcommand*{\missingdata}{}
\renewcommand*{\mylistII}{a,b,\missingdata,d}

Make third item \verb|\missingdata|.

\begin{tabular}{lcccc}
\bfseries List 1: 
\expandafter\docsvlist\expandafter{\mylistI}\\
\bfseries List 2: 
\expandafter\docsvlist\expandafter{\mylistII}
\end{tabular}

\end{document}
