Page 1 of 1

Append date in the File

PostPosted: Thu Feb 16, 2012 5:28 pm
by trilochan_p
Hi,

I have below piece of code in the NDM step and i wanted to append date in the send file (NONEIS-MMDDYYYY).
Please suggest the code changes to add date in the To file.

NDMAPGXK PROCESS SNODE=LIBCDS01.LIB PNODE=CIGNAT                       
STEP1 COPY FROM (PNODE DSN=CEA4.APR00.RCPDSD09.OFAC(0)         -       
               DISP=SHR)                                             -
           COMPRESS EXT                                              -
 TO  (SNODE DSN='\\USLIBFS302\LIBFS44K\OFAC\NONEIS.TXT'              -
           SYSOPTS="STRIP.BLANKS(NO)"                                -
               DISP=RPL) 


Thanks & Regards,
Tilu

Re: Append date in the File

PostPosted: Thu Feb 16, 2012 8:15 pm
by MrSpock
The Symbolic Variable %SUBDATE3 can be used for a mmddyyyy current submitted-date format. You'll have to build a variable string in your process.

NDMAPGXK PROCESS SNODE=LIBCDS01.LIB PNODE=CIGNAT -   
                     DATE=%SUBDATE3     
                     SYMBOL &FILE='\\USLIBFS302\LIBFS44K\OFAC\NONEIS-'.&DATE
STEP1 COPY FROM (PNODE DSN=CEA4.APR00.RCPDSD09.OFAC(0)         -       
               DISP=SHR)                                             -
           COMPRESS EXT                                              -
TO  (SNODE DSN=&FILE -
           SYSOPTS="STRIP.BLANKS(NO)"                                -
               DISP=RPL) 


for example. You're going to have to work out the logisitics of keeping those imbedded single-quotes that you need for the target filename.

Re: Append date in the File

PostPosted: Fri Feb 17, 2012 5:42 am
by trilochan_p
Thanks for your suggestions.

In the mentioned code .txt is missing, If i include .txt then is the code will b as mentioned below:

SYMBOL &FILE='\\USLIBFS302\LIBFS44K\OFAC\NONEIS-'.&DATE.'TXT' -

Instead of decalring sysmbolic variable, can i include below code in the process step it sel, Is it fine.
TO (SNODE DSN='\\USLIBFS302\LIBFS44K\OFAC\NONEIS-'.&DATE.'.TXT' -

Re: Append date in the File

PostPosted: Fri Feb 17, 2012 12:19 pm
by NicC
What happened when you tried?

Re: Append date in the File

PostPosted: Wed Feb 22, 2012 4:49 pm
by trilochan_p
Hi,

I have tried with this code (SNODE DSN='\\USLIBFS302\LIBFS44K\OFAC\NONEIS-'.&DATE..TXT) and
have got this output (\\USLIBFS302\LIBFS44K\OFAC\NONEIS-.02222012.TXT)

Here i am getting dot symbol while adding date in the file name, i have tried so many options to remove this dot sysmbol but not able got success.

Please suggest the code changes to remove this dot symbol in between the file name and date.

Re: Append date in the File

PostPosted: Wed Feb 22, 2012 4:49 pm
by trilochan_p
Hi,

I have tried with this code (SNODE DSN='\\USLIBFS302\LIBFS44K\OFAC\NONEIS-'.&DATE..TXT) and
have got this output (\\USLIBFS302\LIBFS44K\OFAC\NONEIS-.02222012.TXT)

Here i am getting dot symbol while adding date in the file name, i have tried so many options to remove this dot sysmbol but not able got success.

Please suggest the code changes to remove this dot symbol in between the file name and date.

Re: Append date in the File

PostPosted: Sun Feb 26, 2012 8:50 am
by dick scherrer
Hello,

I have no way to test this, but what happens if you remove the "dot" between the quote and &date?