Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. ### doitfaster.py
  2. import os
  3.  
  4. os.system('mode con: cols=100 lines=20')
  5.  
  6. table = raw_input('input table name: ')
  7. primarykey = raw_input('list primary keys, separated by spaces: ')
  8.  
  9. with open('sasjob.txt', 'r') as j:
  10. job = j.read()
  11.  
  12. job = job.format(table=table, primarykey=primarykey)
  13.  
  14. with open('sasjob.sas', 'w') as s:
  15. s.write(job)
  16.  
  17. with open('finished.txt', 'r') as f:
  18. fin = f.read()
  19. fin = fin + '\n' + table
  20.  
  21. with open('finished.txt', 'w') as f:
  22. f.write(fin)
  23.  
  24. with open('horse.txt', 'r') as h:
  25. horse = h.read()
  26. print horse
  27. input()
  28.  
  29.  
  30. ### sasjob.txt
  31. FILENAME WID26 'W:\WID27\batchexport\WID261PLUS.accdb';
  32. FILENAME WID27 'W:\WID27\batchexport\WID27.mdb';
  33.  
  34. PROC IMPORT OUT = WORK.WID261PLUS
  35. DATATABLE = {table}
  36. DBMS = ACCESS REPLACE;
  37. DATABASE = WID26;
  38. SCANMEMO = YES;
  39. USEDATE = NO;
  40. SCANTIME = YES;
  41. RUN;
  42.  
  43. PROC IMPORT OUT = WORK.WID27
  44. DATATABLE = {table}
  45. DBMS = ACCESS REPLACE;
  46. DATABASE = WID27;
  47. SCANMEMO = YES;
  48. USEDATE = NO;
  49. SCANTIME = YES;
  50. RUN;
  51.  
  52. PROC APPEND BASE = WORK.WID27
  53. DATA = WORK.WID261PLUS
  54. FORCE;
  55. RUN;
  56.  
  57. PROC SORT DATA = WORK.WID27
  58. DUPOUT = WORK.DUPLICATESREMOVED
  59. NODUPKEY;
  60. BY {primarykey};
  61. RUN;
  62.  
  63. PROC EXPORT DATA= WORK.WID27
  64. OUTTABLE= {table}
  65. DBMS=ACCESS REPLACE;
  66. DATABASE=WID27;
  67. RUN;
  68.  
  69.  
  70. ### horse.txt
  71.  
  72. # #
  73. %%% ## ##
  74. %%%%% ###%%###
  75. %%%%% ### %%% #
  76. %%%%%% ### %%% ###
  77. %%%% ## %% #######
  78. %%%%% # %% #`#####
  79. %%%%%% # % #########
  80. %%%%% ##### #########
  81. %% ####### #########
  82. ########## ########
  83. ############# #######
  84. ############### ######
  85. ################# #c###
  86. ################# ###
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement