Hi, So I'm pretty stuck here, it seems like there should be an answer but I can't seem to find one. I need to do a %LET NOW1 = %SYSFUNC(TIME(),); for HHMMSSAMPM or HHMMAMPM. I would very much prefer if it could be a 12 hour clock, not 24. It can have a " . " or " - " instead of " : ". It needs to be those because I'm taking a file, copying, pasting (into a new folder), renaming the new file (.csv) and deleting the old file. I need it to be 01-08-2016_thenameofmyfile_513pm(today's date, which I'm using a sysfunc(date(),) for). I really don't care if it's 5.13pm or whatever but it's excel so I cant have a colon in the title. Filename in "D:\&NOW2._&NOW3.&NOW1..csv"; Filename out "D:\&NOW2._&NOW3.&NOW1..csv"; Filename ferase pipe "D:\&NOW2._&NOW3.&NOW1..csv"; Filename ren pipe "D:\&NOW2._&NOW3.&NOW1..csv"; DATA REN; INFILE REN PAD; INPUT OLD $250. ; NEW=TRANWRD(OLD,'12-10-2015',("&NOW2._&NOW1.&NOW3.")); RUN; /*To rename them all*/ DATA _NULL_; SET REN; RC=RENAME(OLD, NEW, 'FILE'); PUT RC; RUN; /* Copy file/Paste file */ DATA _NULL_; LENGTH FILEIN 8 FILEID 8; FILEIN = FOPEN('in','I',1,'B'); FILEID = FOPEN('out','O',1,'B'); REC = '20'x; DO WHILE(FREAD(FILEIN)=0); RC = FGET(FILEIN,REC,1); RC = FPUT(FILEID, REC); RC =FWRITE(FILEID); END; RC = FCLOSE(FILEIN); RC = FCLOSE(FILEID); RUN; FILENAME IN CLEAR; FILENAME OUT CLEAR; /* Delete Old file */ DATA _NULL_ ; rc = FDELETE ('FErase') ; RUN ; FILENAME FErase CLEAR ; This is more or less what I'm doing, though the filename's aren't correct, just put them to show what I'm up to, and theres 700 lines in between. So ya, what I need is a way I can get a time in there that has atleast hour,minute,and am/pm that doesn't have a period in there. If theres a better way of doing this I'm open to it but it's part of an automated program that basically runs 24 hours a day so it needs to have an original name everytime it saves the file. Thanks, Monster
... View more