By the way, in z/OS a “file” is the data on magnetic tape between the beginning of the tape and a “file mark”, or the data between two “file marks.” Period. End of story. There are no “files” on disk storage. z/OS uses “data sets.” A “file” in toy and baby systems is an unstructured stream of bytes, compared to a “data set,” which has a structure.
You are asking two independent questions here.
The simplest way to retrieve a data set name is by using JCL symbols, like this -
// SET NAME='xxx'
//STEP1 EXEC PGM=...
//ADD DD DSN=&NAME,...
//STEP2 EXEC PGM=...,PARM='&NAME'
The program in STEP2 can retrieve the data set name through the parameter text, and substitute it as it desires.
In theory, an Assembler program can retrieve information like this in storage, but the details change from time to time, which would invalidate the program. The Assembler code could be replicated by a very clever programmer in Cobol, or even a Rexx exec, but a system change would wreck the code, and it would be difficult to repair.
There is no "standard" way to send an e-mail in z/OS. If it is possible at your site, you must consult with support at your site. In most sites it seems the program in STEP2 prepares a text file that is sent to another program, perhaps in STEP3, that actually sends the e-mail. The details for your site must be obtained from your site's support.