Representation of a signal in a sparse way is a useful and popular methodology in signal-processing applications. Among several widely used sparse transforms, dictionary learning (DL) algorithms achieve most attention due to their ability in making data-driven nonanalytical (nonfixed) atoms. Various DL methods are well-established in seismic data processing due to the inherent low-rank property of this kind of data. We have introduced a novel data-driven 3D DL algorithm that is extended from the 2D nonnegative DL scheme via the multitasking strategy for random noise attenuation of seismic data. In addition to providing parts-based learning, we exploit nonnegativity constraint to induce sparsity on the data transformation and reduce the space of the solution and, consequently, the computational cost. In 3D data, we consider each slice as a task. Whereas 3D seismic data exhibit high correlation between slices, a multitask learning approach is used to enhance the performance of the method by sharing a common sparse coefficient matrix for the whole related tasks of the data. Basically, in the learning process, each task can help other tasks to learn better and thus a sparser representation is obtained. Furthermore, different from other DL methods that use a limited random number of patches to learn a dictionary, the proposed algorithm can take the whole data information into account with a reasonable time cost and thus can obtain an efficient and effective denoising performance. We have applied the method on synthetic and real 3D data, which demonstrated superior performance in random noise attenuation when compared with state-of-the-art denoising methods such as MSSA, BM4D, and FXY predictive filtering, especially in amplitude and continuity preservation in low signal-to-noise ratio cases and fault zones.