36 %LET g_copydir = xcopy /E /I /Y;
37 %LET g_endcommand =%str( );
39 %LET g_removedir = rd /S /Q;
40 %LET g_removefile = del /S /Q;
41 %LET g_sasstart =
"%sysget(sasroot)/sas.exe";
42 %LET g_splash = -nosplash;
44 * retrieve dateformat from WINDOWS registry *;
45 * Set
default if anything goes wrong *;
46 %LET g_dateformat = _NONE_;
48 %let xwait=%sysfunc(getoption(xwait));
49 %let xsync=%sysfunc(getoption(xsync));
50 %let xmin =%sysfunc(getoption(xmin));
52 options noxwait xsync xmin;
54 %let l_filename = %sysfunc (pathname (work))\retrive_dateformat.txt;
55 %sysexec (reg query
"HKCU\Control Panel\International" /v sShortDate >
"&l_filename.");
57 options &xwait &xsync &xmin;
60 length g_dateformat $40;
61 infile
"&l_filename.";
63 if index (upcase (_INFILE_),
"REG_SZ") then do;
64 dateformat = lowcase (scan (_INFILE_,3," "));
65 * Building SAS-format name from WIN-Dateformat *;
66 * Set default for dateformat *;
67 g_dateformat = "nldate.";
68 * Check if monthname is displayed *;
69 if (index (dateformat,"mmm")=0) then do;
70 * Check order of day month year *;
71 index_d=index (dateformat,"d");
72 index_m=index (dateformat,"m");
73 index_y=index (dateformat,"y");
74 if (index_y < index_m) then do;
75 if (index_d < index_m) then do;
76 g_dateformat = "yyddmm10.";
79 g_dateformat = "yymmdd10.";
83 if (index_d > index_m) then do;
84 g_dateformat = "mmddyy10.";
87 g_dateformat = "ddmmyy10.";
91 call symputx ("G_DATEFORMAT", trim (g_dateformat));