cϽ 1""2"2""2"22""SAS FILEEXAMPLE CATALOG A?A;A,8.0202M0WIN_PROWINAfffكTA?A؃To|Yf  bf g(hhhhhhhf gLf gLf g`hhhhhhhf ggHf g gf g gf ggHf ggf gf gf g@hhhhhhhKf gFhhhhhhhf gf gf g f gf gf g f g7hhhhhhh{f g f (File Edit View Tools Run Solutions Help ,45 #CDEFGHIp p)yPerform file-related operationsPerform editing operationsChange current window viewAccess SAS ToolsRun SAS program codeAccess SAS products and solutionsAccess SAS and product helpFEVTRSH5LSASHELP COREp HELPp 4LSASHELP COREp SOLTIONp,`Submit Recall Last Submit Signon. Remote Submit. Remote Get. Remote Display. Signoff. -./0123$5CU p p"Submit statements for processingRecall previously submitted text.Connect to a remote hostSubmit statements for remote processingSubmit statements for remote processingSubmit statements for remote processingDisconnect from a remote hostSRIBODF3HScript file name:DRemote session name:&Communications access method id value:'Remote session macro variable (macvar):  5NOTE: Leave a field blank to use the current setting.%%signoff(%%nrbquote(@1), %%nrbquote(@2),%%nrbquote(@3), %%nrbquote(@4))2 Remote session name:%%rdisplay(%%nrbquote(@1))1 Remote session name:%%rget(%%nrbquote(@1))0HRemote session name:#Remote session macro variable name: !Display transfer status (yes/no):-Execute remote submit synchronously (yes/no): 5NOTE: Leave a field blank to use the current setting.%%rsubmit(%%nrbquote(@1), %%nrbquote(@2),%%nrbquote(@3), %%nrbquote(@4))/Script file name:DRemote session name:SYSRESR PGBITMAPXSCL FIND_FILES, ۃTtionXLCH ,(XLSRp?A|q:A  XLSR;A;A. Y F  UNTITLED1.SCLXLSRn,An,A   F  XTESTAFX.SCL XLSR /u A/u A -  -  F IMAGEVIEW1.FRAME$>XLSR\A\AQ? Q? F  UNTITLED1.SCLXLSR$ +G2A+G2A  F  UNTITLED1.SCLXLSR AAϩ ɗ F  UNTITLED1.SCLXLSRH GAGA)    F  UNTITLED1.SCLXLSR|ף jAף jA./$ #R@$.  F  HELP_1.FRAME$>XLSRPtSAtSA y0 F FIND_PROCESS.SCL XLSR|g܇A|g܇A  6 * F FIND_PROCESS.SCL XLSR A A 4   F IMAGEVIEW1.FRAME$>XLSRt 5A5A7y=  F  XTESTAFX.SCL tasasasa4ta`uauatatatauajP @Z@jjjjjZjjj ݃T 0#!#_SCLD1_LIIP1RELEASEEXESIZEFLAGS-Z@@ q,\0?P !   $ d( d- d7 d@ dJ dS a i l r x d              p+"+#+$+%+&('((***+*,*-*.( )+/:::(d&(d/(d "(5%0(p*&(7/2(a411 23(a;&M)D&N)D1(E+(L44(Q.4(V**((75]*N)d$Z85]'(e)(j**(q+76]2N(x1M)x186]/$5:y(|33(11/&1/1#::K/&1/1#/#1/1/0/0#::K/&1/10/0/9/9#:=](I;(77>r7?(1(q@/$1(50(pA/1A%(+(CC(77D(+M( %(-(BB*E(BB|(qB(p#A(q1(+(E(pB(7/7(54A(p91(7>3 73FFGEG~*E*E(qB(q4A(+CEEs(JIIH(Q+IHM'T%8?_=p(X,p!.459U]`#)/0' ( ) 000&001&3&21 &3113343) 3*5) ( 3) *36 ' 3/1#' $ ( 0$5X]7' 77;3<;1;7$77=7>=?110@00A%77( 7( D7C7/B"B@BBAA17B7/AA113BAH' H' HG=H  "#$&&'((**-//0113679;<=>@ACEFGGHLNNPPRRTTUVXZZ[[[\]accccdttwxxyzz{|}r>_MSG__STATUS__ERROR__CURROW_endaWpath path_temppathtemp path_namepath_dir path_dir_tempdim_dirrcdid11did21did001 search_str$T0$T1len$T2did01iijj$T3$T4$T5$T6rc_openidid1n1is2$T7$T8did2d܃T`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vF`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v /*`Image Processing`*/`%@v"/*`Songlin Zhu, Ph.D.`*/`%@v/*`9/29/2005`*/`%@v /@>*/`%@v"/*mod = size : Resize`&*/`%@v$/*mod = rota : Rotation`$*/`%@v /@>*/`%@v`w@v init:`r@vdcl char(1)end='';`a@vdcl char(200)a='';`_@vdcl char(100)path ='';`]@v.dcl char(100) path_temp='' pathtemp='';`N@v?dcl char(100) path_name[*] path_dir[*] path_dir_temp[*];`=@v path_name = makearray(0);`\@vpath_dir = makearray(0);`]@v`w@v;dcl num dim_dir=0rc=0did11=0did21=0did001=0;`=@v`w@v%path_dir_temp= makearray(1);`W@v`w@v# /* pathtemp ='C:\zsl\sas';*/`Z@v%dcl char(100) search_str = '';`W@v`w@v return;`p@v`w@v main:`r@v`w@vput 'Please wait .';`V@vput '';`i@vput '';`i@v`w@v!pathtemp = symget('path');`Z@v,search_str = symget('search_string');`O@vend = symget('at_end');`]@v`w@v'pathtemp = trim(left(pathtemp));`T@vlen = length(pathtemp);`]@v)if substr(pathtemp,len) = '\' then`R@v do;`n@v+pathtemp = substr(pathtemp,1,len-1);`J@v end;`m@v`w@v"path_dir_temp[1] =pathtemp;`Y@v`w@v/rc = filename('temp', path_dir_temp[1]);`L@vdid01=dopen("temp");``@v0if did01 > 0 then did001 = dclose(did01);`K@v`w@vif did01 > 0 then`c@v do;`n@v`w@v$dim_dir = dim(path_dir_temp);`R@vdo while(dim_dir > 0);`Y@v`w@v path_dir= makearray(0);`S@v`w@vdo ii = 1 to dim_dir;`W@v path = path_dir_temp[ii];`P@vlink files;`^@v end;`h@v`w@v%path_dir_temp= makearray(0);`N@vdim_dir = dim(path_dir);`T@v`w@vif dim_dir > 0 then`Y@v do;`f@v*rc = REDIM(path_dir_temp, dim_dir);`C@vdo jj = 1 to dim_dir;`Q@v)`path_dir_temp(jj) = path_dir(jj);`B@v end;`b@v end;`e@v*put dim_dir= path_dir;``@v`w@v end;`k@v end;`m@v/else put 'The directory does not exist';`L@v`w@v!if dim(path_name) > 0 then`Z@v do;`n@v+if compress(search_str) = '*.*' then`J@v do;`h@v@a='All files in the directory of "' || pathtemp || '":';`.@vput a;``@vput path_name;`Z@v end;`g@v else`j@v do;`h@vMa= 'In the directory of "' || pathtemp || '" and sub-directories, ';`"@vZa = a || 'there are following files with "' || search_str || '" in its name:' ;`@v߃T`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v0`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v =2@@A#AA@#4#BA?A?@@D$44' 4' 40F4.A.@A@4& 4& 40!&(()**,/0245679:<>?@@AEGGIIKKMMNOQSSTTTUVZ\\\\]`fimorttwwxzz|||~q_MSG__STATUS__ERROR__CURROW_a~path path_temppathtemp path_namepath_dir path_dir_tempdim_dirrcdid11did21did001 search_str$T0$T1did01ij$T2$T3$T4$T5$T6$T7$T8$T9$T10did1n1s2$T11$T12len$T13$T14$T15did2dim02index2dim01C:\zsl\sas.tempThe directory does not existCOMPRESS*.*All files in the directory of "":In the directory of "" and sub-directories, there are following files with "" in its name:", there is no file with "" in its namemydir1\mydir2hl? files`F6HALFHALF 7 10 13 16 19 22`//@>*/`%@v/*`Image Processing`*/`%@v/*`Songlin Zhu, Ph.D.`*/`%@v/*`9/29/2005`*/`%@v/@>*/`%@v/*mod = size : Resize`&*/`%@v/*mod = rota : Rotation`$*/`%@v/@>*/`%@v`w@v/*%macro add_iten(name=, len=);`X@v`w@v`w@v`w@v%mend;`q@v  *ރT/`u@v`w@vinit:`r@v`w@vdcl char(200)a='';`_@vdcl char(200)path ='';`]@vdcl char(200) path_temp='' pathtemp='';`N@vdcl char(200) path_name[*] path_dir[*] path_dir_temp[*];`=@vpath_name = makearray(0);`\@vpath_dir = makearray(0);`]@v/`w@vdcl num dim_dir=0rc=0did11=0did21=0did001=0;`=@v`w@vpath_dir_temp= makearray(1);`W@v`w@vpathtemp ='C:\zsl\sas';`^@vdcl char(100) search_str = '.';`V@v`w@vreturn;`p@v`w@vmain:`r@v`w@v/*path_dir_temp(1) = symput('path');*/`N@vpath_dir_temp[1] =pathtemp;`Y@v`w@v]rc = filename('temp', path_dir_temp[1]);`L@vdid01=dopen("temp");``@vif did01 > 0 then did001 = dclose(did01);`K@v`w@vif did01 > 0 then`c@vdo;`n@v`w@vdim_dir = dim(path_dir_temp);`R@vdo while(dim_dir > 0);`Y@v`w@vpath_dir= makearray(0);`S@v`w@vdo i = 1 to dim_dir;`X@vpath = path_dir_temp[i];`Q@vlink files;`^@vend;`h@v`w@vpath_dir_temp= makearray(0);`N@vdim_dir = dim(path_dir);`T@v`w@vif dim_dir > 0 then`Y@vdo;`f@vrc = REDIM(path_dir_temp, dim_dir);`C@vdo j = 1 to dim_dir;`R@v`path_dir_temp(j) = path_dir(j);`D@vend;`b@vend;`e@v`w@v`w@vend;`k@vend;`m@velse put 'The directory does not exist';`L@v`w@vif dim(path_name) > 0 then`Z@vdo;`n@vif compress(search_str) = '*.*' then`J@vdo;`h@va='All files in the directory of "' || pathtemp || '":';`.@vput a;``@vput path_name;`Z@vend;`g@velse`j@vdo;`h@va= 'In the directory of "' || pathtemp || '" and sub-directories, ';`"@va = a || 'there are following files with "' || search_str || '" in its name:' ;`@vput a;``@vput path_name;`Z@vend;`g@vend;`m@v`w@velse`p@vdo;`n@va) = 'In the directory of "' || pathtemp || '", there is no file with "' || search_str || '" in its name' ;`@vput a ;`d@vend;`m@v`w@vreturn;`p@v`w@v`w@v`w@vfiles:`q@v`w@vrc = filename('mydir1', path);`S@v`w@v* did1 = 0 -- directory coud not be opened *;`0@vdid1=dopen("mydir1");`\@v`w@v*put path= did1=;`f@v`w@vn1 = dnum(did1);`a@v`w@vif n1 > 0 then`c@vdo;`k@v`w@vdo i = 1 to n1;`\@v)`w@vs2 = upcase(dread(did1,i));`M@v`w@v`w@vpath = trim(left(path));`P@vlen = length(path);`U@v`w@vif substr(path,len) = '\' then`J@v`do;`b@v`path_temp = path || trim(left(s2));`?@v`end;`a@velse`d@v`do;`b@v`path_temp = path || '\' ||trim(left(s2));`9@v`end;`a@vI`w@vrc=filename("mydir2",path_temp);`H@v`w@v* did2 = 0 -- directory coud not be opened *;`'@vdid2=dopen('mydir2');`S@v`w@vif did2 > 0 then`X@v`do;`b@v` dim02=dim(path_dir);`H@v` rc = REDIM(path_dir, dim02 + 1);`<@v` path_dir(dim02 + 1) = path_temp;`<@v`w@v` did21 =dclose(did2);`H@v`w@v`end;`a@vYelse`d@v`do;`b@v`if compress(search_str) = '*.*' then index2 = 1;`2@v`else`index2 = index(upcase(s2),upcase(search_str));`@v`if index2 > 0 then`P@v`do;`\@v` dim01 = dim(path_name);`E@v` rc = REDIM(path_name, dim01 + 1);`;@v` path_name(dim01 + 1) = path_temp;`;@v`end;`[@v`end;`a@vend;`g@v`w@vend;`j@v`w@vуTor)tput a;``@vput path_name;`Z@v end;`g@v end;`m@v`w@v else`p@v do;`n@vsa) = 'In the directory of "' || pathtemp || '", there is no file with "' || search_str || '" in its name' ;`@vput a ;`d@v end;`m@v`w@v/* Create a data set */``@v`w@vsubmit continue;`c@v`w@vdata file_names;`a@v`w@vlength path_name $200;`W@vdelete;`f@v`w@v run;`m@v)proc print data = work.file_names;`Q@v run;`o@v`w@vendsubmit;`k@v`w@v4/* Write file name and path in the data set */`I@v-rc_open = open('work.file_names','U');`O@v$do i = 1 to dim(path_name);`U@vrc=append(rc_open);`\@v/call putvarc(rc_open, 1,path_name(i));`G@vrc=update(rc_open);`\@v end;`n@vrc = close(rc_open);`a@v`w@vput '';`i@vput '';`i@vput 'End of processing';`]@v`w@v`w@v`w@v return;`p@v`w@v`w@v`w@v files:`q@v`w@v%rc = filename('mydir1', path);`S@v`w@v7* did1 = 0 -- directory coud not be opened *;`0@vdid1=dopen("mydir1");`\@v`w@v*put path= did1=;`f@v`w@vn1 = dnum(did1);`a@v`w@vif n1 > 0 then`c@v do;`k@v`w@vdo i = 1 to n1;`\@v`w@v"s2 = upcase(dread(did1,i));`M@v`w@v0path_temp = path || '\' ||trim(left(s2));`?@v`w@v`w@v'rc=filename("mydir2",path_temp);`H@v`w@v7* did2 = 0 -- directory coud not be opened *;`'@vdid2=dopen('mydir2');`S@v`w@vif did2 > 0 then`X@v `do;`b@v`w@v ` dim02=dim(path_dir) +1 ;`D@v$` rc = REDIM(path_dir, dim02);`@@v$` path_dir(dim02) = path_temp;`@@v`w@v` did21 = dclose(did2);`G@v`w@v `end;`a@v else`d@v `do;`b@v8`if compress(search_str) = '*.*' then index2 = 1;`2@v(`else if compress(end) = 'Y' then`B@v `do;`\@v`w@v<` index2 = index(trim(upcase(s2)),upcase(search_str));`(@vZ` if index2 = length(trim(s2)) - length(trim(left(search_str) + 1 then index2 = 1;` @v` else index2 = 0;`L@v `end;`[@v<`elseindex2 = index(upcase(s2),upcase(search_str));`.@v`if index2 > 0 then`P@v `do;`\@v` dim01 = dim(path_name);`E@v)` rc = REDIM(path_name, dim01 + 1);`;@v)` path_name(dim01 + 1) = path_temp;`;@v `end;`\@v `end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@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v҃T Hrq-RRjLzzs1sl1lST | 3|A| AI ||<{{=ll?zdI|d|JI| I|KJ}}zz{IlsIJG h| XYM ##$**+112889??@GHIJKKKKKLQSYYYYYYYYYZZZZZZZZ[]^`````````abcdefgkkkkkkkklnoqqqqqqqqqrstuvwy}}}}}}}}~    !"#%&&')**+-../122356679::;=>>>>>>>>>>>?ABDDEFHIJPQRRRSUVVWWWWWWWWYZbdfffffffffghiiijkkllmnoprtttttttttuvwwwxyyzz{|}~sspY_MSG__STATUS__ERROR__CURROW_ title_text_1Temp_dirmakefile_reset_1makefile_reset_2 project_titleproject_title_1 form_namemakefile_reset_6 form_name_1makefile_reset_3pathpath_1form_dirmakefile_reset_7 form_dir_1programmer_namemakefile_reset_5programmer_name_1dir_chkmakefile_reset_8 dir_chk_1 Text_temp_1makefile_reset_0 makefile_ok_1makefile_cancel_1makefile_help_1_CURCOL__SELF__FRAME__CFRAME_ rc_fntemp rc_fotemprc_fgetrc_fread rc_fctemprc_fendoldindexend_ijtemp_strold_strnew_strstr_temp editAnswerp0p1p2p$3 temp_file_0new_filerc_str1msg_strmsg_str1msg_num type_message1 type_message2rc_msg1rc_msg2rc_msg3rcrc_ferc_dirrc_fn1rc_fn2rc_dopen rc_dcloserc_fopen rc_fclose rc_fdeleterc_fputi$T0$T1$T2$T3$T4$T5$T6$T7$T8$T9$T10$T11$T12$T13$T14$T15$T16$T17$T18$T19$T20$T21$T22$T23$T24 commandlistSASHELP.CLASSES.GRAPHICTEXT_C.CLASASHELP.CLASSES.TEXTENTRY_C.CLASStextSASHELP.CLASSES.PUSHBUTTON_C.CLASASHELP.CLASSES.TEXTLABEL_C.CLASS_onPopup_SetAttributeValue(CC)Vfref1_GetAttributeValue(C)C\\datadata was not created Check the input carefully!o\prtprtCheck the input carefully.\pgmpgm is invalid.\pgm\ Exists.Do you want to replace it?YNYfref2 could not be replaced._c.sas_ea.sas_eb.sas_com.sas_new.sas_up.sas_sum.inc_chk.sas_chk.inc.scrtemptemp_file_0= was create succesfully. was not created. was not replaced.cc_fref does not Exist.e#form##programmer##projՃT  im02index2$T9$T10$T11dim01Please wait .pathsearch_stringat_end\tempThe directory does not existCOMPRESS*.*All files in the directory of "":In the directory of "" and sub-directories, there are following files with "" in its name:", there is no file with "" in its namework.file_namesUEnd of processingmydir1mydir2Y_hlZ %data file_names;length path_name $200;delete;run;"proc print data = work.file_names;run; files`6HALFHALF 7 10 13 16 19 22`//@>*/`%@v/*`Image Processing`*/`%@v/*`Songlin Zhu, Ph.D.`*/`%@v/*`9/29/2005`*/`%@v/@>*/`%@v/*mod = size : Resize`&*/`%@v/*mod = rota : Rotation`$*/`%@v/@>*/`%@v`w@vinit:`r@vdcl char(1)end='';`a@vdcl char(200)a='';`_@vdcl char(100)path ='';`]@vdcl char(100) path_temp='' pathtemp='';`N@v\dcl char(100) path_name[*] path_dir[*] path_dir_temp[*];`=@vpath_name = makearray(0);`\@vpath_dir = makearray(0);`]@v`w@vdcl num dim_dir=0rc=0did11=0did21=0did001=0;`=@v`w@vpath_dir_temp= makearray(1);`W@v`w@v /* pathtemp ='C:\zsl\sas';*/`Z@vdcl char(100) search_str = '';`W@v`w@vreturn;`p@v`w@vmain:`r@v`w@veput 'Please wait .';`V@vput '';`i@vput '';`i@v`w@vpathtemp = symget('path');`Z@vsearch_str = symget('search_string');`O@vend = symget('at_end');`]@v`w@vpathtemp = trim(left(pathtemp));`T@vlen = length(pathtemp);`]@vif substr(pathtemp,len) = '\' then`R@vdo;`n@vpathtemp = substr(pathtemp,1,len-1);`J@vend;`m@v`w@vTpath_dir_temp[1] =pathtemp;`Y@v`w@vrc = filename('temp', path_dir_temp[1]);`L@vdid01=dopen("temp");``@vif did01 > 0 then did001 = dclose(did01);`K@v`w@vif did01 > 0 then`c@vdo;`n@v`w@vdim_dir = dim(path_dir_temp);`R@vdo while(dim_dir > 0);`Y@v`w@vpath_dir= makearray(0);`S@v`w@vdo ii = 1 to dim_dir;`W@vQpath = path_dir_temp[ii];`P@vlink files;`^@vend;`h@v`w@vpath_dir_temp= makearray(0);`N@vdim_dir = dim(path_dir);`T@v`w@vif dim_dir > 0 then`Y@vdo;`f@vrc = REDIM(path_dir_temp, dim_dir);`C@vdo jj = 1 to dim_dir;`Q@v`path_dir_temp(jj) = path_dir(jj);`B@vend;`b@vend;`e@v*put dim_dir= path_dir;``@v3`w@vend;`k@vend;`m@velse put 'The directory does not exist';`L@v`w@vif dim(path_name) > 0 then`Z@vdo;`n@vif compress(search_str) = '*.*' then`J@vdo;`h@va='All files in the directory of "' || pathtemp || '":';`.@vput a;``@vput path_name;`Z@vend;`g@velse`j@vdo;`h@va= 'In the directory of "' || pathtemp || '" and sub-directories, ';`"@va = a || 'there are following files with "' || search_str || '" in its name:' ;`@vput a;``@vput path_name;`Z@vend;`g@vend;`m@v`w@velse`p@vdo;`n@va) = 'In the directory of "' || pathtemp || '", there is no file with "' || search_str || '" in its name' ;`@vput a ;`d@vend;`m@v`w@v/* Create a data set */``@v`w@v#submit continue;`c@v`w@vdata file_names;`a@v`w@vlength path_name $200;`W@vdelete;`f@v`w@vrun;`m@vproc print data = work.file_names;`Q@vrun;`o@v`w@vendsubmit;`k@vԃT `w@v/* Write file name and path in the data set */`I@vrc_open = open('work.file_names','U');`O@vdo i = 1 to dim(path_name);`U@vrc=append(rc_open);`\@vcall putvarc(rc_open, 1,path_name(i));`G@vrc=update(rc_open);`\@vend;`n@vrc = close(rc_open);`a@v`w@vput '';`i@vput '';`i@vput 'End of processing';`]@v`w@v`w@v`w@vreturn;`p@v`w@v`w@v`w@vfiles:`q@v`w@vrc = filename('mydir1', path);`S@v`w@v* did1 = 0 -- directory coud not be opened *;`0@vdid1=dopen("mydir1");`\@v`w@v*put path= did1=;`f@v`w@vn1 = dnum(did1);`a@v`w@vif n1 > 0 then`c@vdo;`k@v'`w@vdo i = 1 to n1;`\@v`w@vs2 = upcase(dread(did1,i));`M@v`w@vpath_temp = path || '\' ||trim(left(s2));`?@v`w@v`w@vrc=filename("mydir2",path_temp);`H@v`w@v* did2 = 0 -- directory coud not be opened *;`'@vdid2=dopen('mydir2');`S@v`w@vif did2 > 0 then`X@v`do;`b@vb`w@v` dim02=dim(path_dir) +1 ;`D@v` rc = REDIM(path_dir, dim02);`@@v` path_dir(dim02) = path_temp;`@@v`w@v` did21 = dclose(did2);`G@v`w@v`end;`a@velse`d@v`do;`b@v`if compress(search_str) = '*.*' then index2 = 1;`2@v`else if compress(end) = 'Y' then`B@v`do;`\@v`w@v` index2 = index(trim(upcase(s2)),upcase(search_str));`(@v` if index2 = length(trim(s2)) - length(trim(left(search_str) + 1 then index2 = 1;` @v` else index2 = 0;`L@v`end;`[@v`elseindex2 = index(upcase(s2),upcase(search_str));`.@v`if index2 > 0 then`P@v`do;`\@v` dim01 = dim(path_name);`E@v` rc = REDIM(path_name, dim01 + 1);`;@v` path_name(dim01 + 1) = path_temp;`;@v`end;`\@v`end;`a@vend;`g@v`w@vend;`j@v`w@vif did1 > 0 then did11 = dclose(did1);`K@v`w@vreturn;`p@v`w@v`w@vterm:`r@v`w@vreturn;`p@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v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`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@ṽT `w@v* did2 = 0 -- directory coud not be opened *;`'@vdid2=dopen('mydir2');`S@v`w@vif did2 > 0 then`X@v`do;`b@v`if compress(search_str) = '*.*' then index2 = 1;`2@v`else`index2 = index(upcase(s2),upcase(search_str));`@v`if index2 > 0 then`P@v`do;`\@v` dim02=dim(path_dir);`H@v` rc = REDIM(path_dir, dim02 + 1);`<@v` path_dir(dim02 + 1) = trim(left(path_temp));`0@v`w@v` did21 =dclose(did2);`H@v`end;`[@v`w@v`end;`a@v`w@vend;`g@v`w@vend;`j@v`w@vif did1 > 0 then did11 = dclose(did1);`K@v`w@vreturn;`p@v`w@v`w@vterm:`r@v`w@vSreturn;`p@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vK`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@vP`w@v`w@v`w@v`w@v`w@v SYSBACK AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK  σT AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK  AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK  AFCNTRLSYSFORE SYSBACK  AFCNTRLSYSFORE SYSBACK  AFCNTRLSYSFORE SYSBACK  AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK AFCNTRLSYSFORE SYSBACK  ΃T end;`m@v`w@vEif editAnswer = 'Y' then makefile_ok_1.commandOnClick = 'end';`7@v return;`p@v`w@v /@D*/`@v/*Display message`2*/`@v /@D*/`@vmessage_box:`k@vcommandlist=makelist();`^@vdo i = 1 to end_i;`c@v6commandlist=insertc(commandlist, msg_str[i],i);`D@v end;`q@vFeditAnswer=messagebox(commandlist,type_message1,type_message2);`6@v return;`p@v`w@v /@D*/`@v/*Reset all inputs`1*/`@v /@D*/`@vmakefile_reset_0:`f@vproject_title.text = '';`\@vpath.text = '';`e@v!programmer_name.text = '';`Z@vform_name.text = '';``@vform_dir.text = '';`a@vdir_chk.text = '';`b@vtemp_dir.text = '';`a@v return;`p@v`w@v /@D*/`@v/*Exit application`1*/`@v /@D*/`@vmakefile_cancel_1:`e@v_msg_ = 'cancel';`d@v return;`p@v`w@v /@D*/`@v$/*Call help imformation`+*/`@v /@D*/`@vmakefile_help_1:`g@v$call display('help_1.frame');`W@v return;`p@v`w@v /@D*/`@v term:`r@v return;`p@vT`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w@v`w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@v`w@vinit:`r@v`w@vdcl char(4) process_mod='';`Z@vdcl char(200) in_name=''out_name='';`N@vdcl num im_width=0im_height=0type=0depth=0 im_scale width_temp=0 height_temp=0;`@vdcl char(50) im_format = '';`Y@vtaskid=imginit(0,'nodisplay');`W@v`w@v`w@vdcl char(200)a='';`_@vdcl char(100)path ='';`]@vdcl char(100) path_temp='' pathtemp='' path_out='';`B@vdcl char(100) path_name[*] path_dir[*] path_dir_temp[*] sub_dir[*] sub_name[*};`&@vpath_name = makearray(0);`\@vpath_dir = makearray(0);`]@vsub_dir = makearray(0);`^@vsub_name = makearray(0);`]@v`w@vdcl num dim_dir=0rc=0did11=0did21=0did001=0;`=@v`w@vpath_dir_temp= makearray(1);`W@v`w@vdcl char(100) search_str = '';`W@v`w@vreturn;`p@v`w@v`w@vmain:`r@v`w@vput 'Please wait .';`V@vput '';`i@vput '';`i@v`w@vpathtemp= symget('in_path');`U@vpath_out= symget('out_path');`T@vsearch_str = symget('search_string');`O@vcur_dir= symget('current_dir');`Q@v`w@v/@*/`J@v/*Check existance of the directory*/`J@v/*and create it is it does not exist */`J@v/@*/`J@vlink check_create_dir;`^@v`w@v/@*/`J@v/*If path end with "\" like c:\a\, */`J@v/*get rid of "\" to change it to*/`J@v/*c:\a.` */`J@v/@*/`J@vpathtemp = trim(left(pathtemp));`T@v`len = length(pathtemp);`]@vif substr(pathtemp,len) = '\' then`R@vdo;`n@vpathtemp = substr(pathtemp,1,len-1);`J@vend;`m@v`w@v`w@vpath_dir_temp[1] =pathtemp;`Y@v`w@v/@*/`J@v/*Check the existance of input*/`J@v/*directory` */`J@v/@*/`J@vrc = filename('temp', path_dir_temp[1]);`L@vdid01=dopen("temp");``@vRif did01 > 0 then did001 = dclose(did01);`K@v`w@v/@*/`H@v/*Get file anmes in a directory*/`H@v/*and save links to an array*/`H@v/@*/`H@vif did01 > 0 then`c@vdo;`n@v`w@vdim_dir = dim(path_dir_temp);`R@vdo while(dim_dir > 0);`Y@v`w@vpath_dir= makearray(0);`S@v`w@vdo ii = 1 to dim_dir;`W@v)path = ŃTpath_dir_temp[ii];`P@v`w@v/@*/`=@v/*Get file names in a directory*/`=@v/@*/`=@vlink files;`^@v`w@vend;`h@v`w@vpath_dir_temp= makearray(0);`N@vdim_dir = dim(path_dir);`T@v`w@vif dim_dir > 0 then`Y@vdo;`f@vrc = REDIM(path_dir_temp, dim_dir);`C@vIdo jj = 1 to dim_dir;`Q@v`path_dir_temp(jj) = path_dir(jj);`B@vend;`b@vend;`e@vif compress(upcase(cur_dir)) = 'Y' then dim_dir = 0;`8@v`w@vend;`k@vend;`m@velse put 'The directory does not exist';`L@v`w@v/@*/`J@v/*Print information on log window*/`J@v/@*/`J@vlink print_info;`d@v`w@v/@*/`J@v/*Image processing*/`J@v/@*/`J@vlink processing;`d@v`w@v`w@vput '';`h@vput '';`h@vput 'End of processing';`\@v`w@vreturn;`p@v`w@v`w@v/@*/`Q@v/* Print information on log window*/`Q@v/@*/`Q@vprint_info:`l@v`w@vif dim(path_name) > 0 then`Z@vdo;`n@vif compress(search_str) = '*.*' then`J@vdo;`h@va='All files in the directory of "' || pathtemp || '":';`.@vput a;``@vput path_name;`Z@vend;`g@velse`j@vdo;`h@va= 'In the directory of "' || pathtemp || '" and sub-directories, ';`"@va = a || 'there are following files with "' || search_str || '" in its name:' ;`@v put a;``@vput path_name;`Z@vend;`g@vend;`m@v`w@velse`p@vdo;`n@va) = 'In the directory of "' || pathtemp || '", there is no file with "' || search_str || '" in its name' ;`@vput a ;`d@vend;`m@v`w@vreturn;`p@v`w@v`w@v/@*/`D@v./* Get names of folders and files in a directory */`D@v/@*/`D@vfiles:`q@v`w@vrc = filename('mydir1', path);`S@v`w@v* did1 = 0 -- directory coud not be opened *;`0@vdid1=dopen("mydir1");`\@v`w@vn1 = dnum(did1);`a@v`w@vif n1 > 0 then`c@vdo;`k@v`w@vdo i = 1 to n1;`\@v1`w@vs2 = upcase(dread(did1,i));`M@v`w@vpath_temp = path || '\' ||trim(left(s2));`?@v`w@v`w@vrc=filename("mydir2",path_temp);`H@v`w@v* did2 = 0 -- directory coud not be opened *;`'@vdid2=dopen('mydir2');`S@v`w@vif did2 > 0 then`X@v`do;`b@v`w@v` dim02=dim(path_dir) +1 ;`D@v` rc = REDIM(path_dir, dim02);`@@v` path_dir(dim02) = path_temp;`@@v`w@v` did21 = dclose(did2);`G@v`w@v`end;`a@velse`d@v`do;`b@v`if compress(search_str) = '*.*' then index2 = 1;`2@v`else`index2 = index(upcase(s2),upcase(search_str));`@v`if index2 > 0 then`P@v`do;`\@v` dim01 = dim(path_name);`E@v` rc = REDIM(path_name, dim01 + 1);`;@v` path_name(dim01 + 1) = path_temp;`;@v`end;`[@v`end;`a@vend;`g@v`w@vend;`j@v`w@vif did1 > 0 then did11 = dclose(did1);`K@v`w@v`w@v`w@vreturn;`p@v`w@v`w@v/@*/`Q@v/* Image processing*/`Q@v/@*/`Q@vprocessing:`l@v`w@vdo j = 1 to dim(path_name);`W@v`w@vin_name= trim(left(path_name(j);`H@v`w@vleng=length(path_name(j));`S@vput leng=;`e@v`w@vk = leng;`d@vdo while(substr(path_name(j),k,1) ne '\');`A@vk=k-1;`b@vend;`k@v`w@vk1 = k+1ăT;`b@v* path_name(j) = substr(path_name(j), 1, k) || 'A_' || substr(path_name(j), k1);`@vpath_name(j) = trim(left(path_out)) || '\A_' || substr(path_name(j), k1);`@vout_name= trim(left(path_name(j);`H@v`w@vput '@*' j= out_name=;`F@v`w@vim_format = compress('format=' || symget('image_format'));`5@v`w@vrc=imgop(taskid,'READ',in_name,im_format);`E@vrc=imgop(taskid,'QUERYN','TYPE',type);`I@vrc=imgop(taskid,'QUERYN','DEPTH',depth);`G@v`w@vput '@- ';`8@vput ' ';`g@vput 'Input image name and path : ' in_name;`B@vput ' Output image name and path : ' out_name;`A@vput 'Color depth: ' depth;`D@vput 'Image format : ' im_format;`@@v`w@vprocess_mod = symget('mod');`S@voriginal_rate =symget('keep_rate');`L@v`w@v/@!*/`9@v/*Resize image`*/`9@v/@!*/`9@v`w@vif upcase(process_mod) = 'SIZE' then do;`G@v`w@vlink resize;``@v`w@v`w@vif im_scale <= 0 then`W@vdo;`f@vif compress(upcase(original_rate)) = 'Y' then`:@v`do;`a@v`if im_height > 0 then`L@v`do;`[@v` rc=imgop(taskid,'QUERYN','WIDTH',im_width);`0@v` rc=imgop(taskid,'QUERYN','HEIGHT',height_temp);`,@v` im_width = im_width * im_height / height_temp;`-@v`end;`Z@v`else if im_width > 0 then`H@v`do;`[@v` rc=imgop(taskid,'QUERYN','WIDTH',width_temp);`.@vC` rc=imgop(taskid,'QUERYN','HEIGHT',im_height);`.@v` im_height = im_height * im_width / width_temp;`-@v`end;`Z@v`else`]@v`do;`[@v` put 'Please give image width or height!';`0@v` stop;`V@v`end;`Z@v`w@v`end;``@v`w@vrc=imgop(taskid,'SCALE',im_width,im_height);`:@vend;`e@velse`h@vdo;`f@vrc=imgop(taskid,'QUERYN','WIDTH',im_width);`;@vrc=imgop(taskid,'QUERYN','HEIGHT',im_height);`9@v`w@vim_width= im_width* im_scale;`E@vim_height = im_height * im_scale;`E@v`w@vput '`Scale : ' im_scale;`8@vput 'Image width : ' im_width;`8@vput 'Image height : ' im_height;`7@v`w@v`w@vrc=imgop(taskid,'SCALE',im_width,im_height);`:@v`w@vend;`e@v`w@v`w@v`w@vend;`k@v`w@v`w@v/@!*/`9@v/*Resize image`*/`9@v/@!*/`9@v`w@vif upcase(process_mod) = 'ROTA' then do;`F@v`w@vlink rotate;`^@vrc=imgop(taskid,'ROTATE',r_degree);`G@v`w@vput 'Rotation degree : ' r_degree;`<@v`w@vend;`j@v`w@v`w@vrc=imgop(taskid,'WRITE',out_name, im_format);`A@v`w@vend;`p@v`w@vreturn;`p@v`w@v`w@v/@*/`G@v/* Get information from SAS data step program */`G@v/@*/`G@vresize:`p@vA`w@v`w@vim_scale= input(symget('scale'),best.);`K@vif im_scale = 0 then``@vdo;`o@vim_width= input(symget('image_width'),best.);`A@vim_height = input(symget('image_height'),best.);`@@vend;`n@v`w@vreturn;`p@v`w@v`w@v/@*/`G@v/* Get information from SAS data step program */`G@v/@*/`G@v1rotate:`p@v`w@vr_degree = input(symget('degree'),best.);`K@v`w@vreturn;`p@v`w@v`w@v/@*/`G@v/*Check existance of the directory*/`G@v/*and create it is it does not exist*/`G@v/@*/`G@vcheck_create_dir:`f@v`w@vpath_out = trim(path_out);`Z@vleng1 = length(path_out);`[@vg iǃTf substr(path_out, leng1) = '\' then path_out = substr(path_out,1,leng1-1);`(@v`w@vrc = REDIM(sub_dir, 1);`]@vsub_dir(1) = path_out;`^@vrc = REDIM(sub_name, 1);`\@vsub_name(1) = '';`c@v`w@vdim02 = 1;`j@v`w@vleng1 = length(path_out);`[@vdo l = 1 to leng1;``@v`w@vif substr(sub_dir(dim02),leng1-l,1) = '\' then`A@vdo;`k@v`w@v`dim02 = dim(sub_dir);`L@v`rc = REDIM(sub_dir, dim02 + 1);`B@v`sub_dir(dim02 + 1)= substr(sub_dir(dim02), 1, leng1-l);`&@v`rc = REDIM(sub_name, dim02 + 1);`A@v`sub_name(dim02 + 1) = substr(sub_dir(dim02), leng1-l+1);`'@v`leng2 = length(sub_name(dim02 + 1));`=@v`if substr(sub_name(dim02 + 1),leng2) = '\' then`2@v`sub_name(dim02 + 1) = substr(sub_name(dim02 + 1),1,leng2-1);`@v`w@vend;`j@vend;`p@v`w@vdim03 = dim(sub_dir);`_@v`w@vwif dim03 > 0 then;`b@vdo;`n@vdim04 = 1;`d@v`w@vrc = filename('temp1', sub_dir(dim04));`G@vdid01=dopen("temp1");`Y@vif did01 > 0 then did011 = dclose(did01);`E@v`w@vdo while(did01 <= 0);`Y@v`w@vdim04 = dim04 + 1;`Y@vrc = filename('temp1', sub_dir(dim04));`D@vdid01=dopen("temp1");`V@vif did01 > 0 then did001 = dclose(did01);`B@vend;`j@v`w@vdo n = dim04 to 2 by -1;`T@vnewdir=dcreate(sub_name(n),sub_dir(n));`@@vput newdir=;`_@vend;`j@v`w@vend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