

* iterate through the entire days supply of each opioid script: */ * iterate through the CLAIMS dataset until the end-of-file (EOF) is reached */ RC=PATIENT_MMES.DEFINEDATA('PATIENT_ID','DATE','TOTAL_MMES') * define the data to be included in the PATIENT_MMES hash table, adding the TOTAL_MMES column, which we will be adding to as we iterate through the dataset CLAIMS */ RC=PATIENT_MMES.DEFINEKEY('PATIENT_ID','DATE') * define the two-part key for the hash table: PATIENT_ID and DATE */ * define the hash table PATIENT_MMES, it starts out empty */
Sas to spss code converter how to#
I have relied on several SAS papers describing how to use hash tables, please see the references section at the end of this article.Īssume dataset CLAIMS has the following columns: PATIENT_ID, RX_FILL_DATE, NDC_CODE, DAYS_SUPPLY, QTY_DISPENSED, DAILY_MME_DOSE, STRENGTH_PER_UNIT, MME_CF (MME conversion factor), and that the DAILY_MME_DOSE column has already been calculated using the formula below:ĭAILY_MME_DOSE = STRENGTH_PER_UNIT*(QTY_DISPENSED/DAYS_SUPPLY)*MME_CFĬreate a DATA _NULL_ step, which will loop through the dataset CLAIMS, and add the patient’s daily MME doses across multiple opioid prescriptions and multiple prescribers, if there are any. The second method of calculating a patient’s daily opioid MME dose involves SAS Hash Tables.

Maybe if I share the code and explain what it does, someone could help me? It would be a paying job $$. I can do all of this in SAS but SAS does not make it is to distribute code. The deliverable back to the end user would be summary file(s) of the patient's daily opioid MME dose, and other reports the end-user may want. The code is not terribly complicated, but I don't know where to start to convert it to a self-contained executable with a user interface so that the end-user can browse a file on their system, then run the program to calculate the MME per patient. The reason is, the data privacy is very important with medical claims. I do have the option of SAS/Connect, which is a client/server setting, but I want my end-users to keep their data on their systems, and not upload to a SAS server in the cloud. Deploying any kind of SAS distributable is difficult because the end-user would have to have a SAS license, which is very expensive. These values should match the output values produced by the provided STATA syntax exactly.I am a SAS programmer, and have built an opioid morphine milligram equivalent (MME) calculator using Base/SAS.
Sas to spss code converter pdf#
spv file of the converted SPSS syntaxģ) Word or pdf of log file showing SPSS syntax and output values. csv formatģ) pdf log file showing STATA syntax and output valuesĥ) Excel file listing the indicator calculations that need to be updatedġ). do file of STATA syntax to be convertedĢ) data files used to run the code in. The contractor will be provided with the following files:ġ). This previously converted SPSS code will be provided for reference, along with a list of the indicator calculations in that SPSS code that need to be fixed to reflect the STATA code provided. STATA syntax calculating the same indicators was previously converted to SPSS, but has since been updated there were also issues in the SPSS code that caused some of the outputs not to match the values produced by the STATA syntax. The indicator calculation STATA syntax needs to be converted to SPSS to produce the same output values.
