IBM Support

Copy a file from C:D z/OS to C:D Windows where the filename contains an embedded symbolic.

Technical Blog Post


Abstract

Copy a file from C:D z/OS to C:D Windows where the filename contains an embedded symbolic.

Body

The problem with attempting to copy to a Windows filenames with an embedded symbolic is the symbolic itself. If the filename is enclosed within single quotes, it is passed "as is" to Windows leaving the symbolic unresolved. However, if the filename is enclosed within double quotes, the filename is put through the parser where the backslash ('\') is treated like a delimiter and removed. Therefore, special care is needed to get around this.
 
The following example includes the following filename needed on the Windows: 
 
     C:\CDSystem\test\Windows.P20151109.txt
 
where the P20151109 is P followed by the date in YYYYMMDD format.
 
There are a few ways to do this, but the simplest way is to break up the file into sections and use a SYMBOL statement, as in the following example:
 
SYMBCOPX PROCESS SNODE=CDWIN46          -
                 &DATE=%SUBDATE1        -
                 &FA=C:                 -
                 &F1=CDSystem           -
                 &F2=test               -
                 &F3=Windows.P          -
                 &F4=txt
  SYMBOL &F5 = \'\|| &FA || \\\\ || &F1 || \\\\ || &F2 || \\\\ ||  -
     &F3 || &DATE || . || &F4 || \'\
STEP1  COPY FROM (PNODE DSN=CD.TEST.FILE)             -
            COMPRESS EXT                              -
            TO (SNODE FILE=&F5                        -
              SYSOPTS="DATATYPE(TEXT),XLATE(YES)"     -
              DISP=NEW)
 
This process can be submitted as a standalone process or via DMBATCH. Different date formats or different values can be used by using different intrinsic symbolics.
 
If submitted on hold, viewing the process shows the following:
 
STEP1    COPY FROM                                                   -
          (PNODE                                                     -
           DSN='JMCGE1.TEST.FILEA'                                   -
           DISP=(SHR,KEEP,KEEP)                                      -
          )                                                          -
              TO                                                     -
          (SNODE                                                     -
           DSN='C:\CDSystem\test\Windows.P20151109.txt'              -
           DISP=(RPL)                                                -
          )                                                          -
           COMPRESS EXTENDED

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS4PJT","label":"IBM Sterling Connect:Direct"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11123803