*** THIS PROGRAM CONVERTS NAACCR V22 XML DATA FILES ***; *** TO THE FORMAT REQUIRED FOR THE VENUSCANCER DATA SUBMISSION. ***; *** U.S. REGISTRIES NEED TO MAKE CHANGES TO ITEMS 1-10 BELOW. ***; *** Canadian registries, Puerto Rico, or any other registry without ***; *** county will also need to make changes to lines 949-952 ***; *** Updated: January 17, 2023 ***; *** Major changes to accomodate 2018 data elements ***; *** Updated: February 28, 2023 ***; *** Changes to primary site inclusion, grading for 2018, ***; *** progesteron, estrogen, FISH, IHC fields ***; *** Updated: March 20, 2023 ***; *** Changes to include date component of DOB ***; *** Last updated: May 31, 2023 ***; *** Changes to include date component follow-up among passive ***; *** follow-up registries to '31' instead of '99' ***; *** 1. CHANGE THE LIBNAME PATH TO THE DIRECTORY YOU WISH TO WRITE SAS HTML ***; *** OUTPUT TO (UNDER SAS 9.3+). ***; ods html path="R:\EPI\CANCER\External_Data_Requests\CONCORD\VENUSCANCER\NAACCR_to_VENUSCANCER_SAS\V22_to_VENUS" gpath="R:\EPI\CANCER\External_Data_Requests\CONCORD\VENUSCANCER\NAACCR_to_VENUSCANCER_SAS\V22_to_VENUS"(URL=none); ods html newfile=proc; *** 2. READ IN NAACCR V22 FILE USING IMS NAACCR XML TOOLS THE VENUSCANCER ***; *** DATA SUBMISSION. IF YOU DO NOT HAVE IMS NAACCR XML TOOLS, THEY CAN BE ***; *** ACCESSED ON GITHUB (HERE: https://github.com/imsweb/naaccr-xml/wiki) ***; *** AND VIA THE NAACCR WEBSITE (HERE: ***; *** https://www.naaccr.org/xml-data-exchange-standard/#Software ***; /************************************************************************************************************; The program includes and calls the "read_naaccr_xml_macro.sas" macro. The program assumes that the JAR file is in the same folder as this program. Make sure that the naaccrVersion and recordType are correct or some data items won't be correctly populated. The code below includes the data items required for this SAS program and the VENUSCANCER submission, meaning that only the data items listed in “items” will be included in the resulting date set. The “items” parameter is however is optional and if not provided (or commented out), the data set will contain all standard items plus any non-standard items provided via the extra dictionary. Be aware that creating a data set containing all items will be MUCH slower than creating one for just a few items, and so if you only need a subset of the NAACCR items to do your analysis, it is strongly recommended to include the “items” statement in the below macro code. If you would like to include additional data items, you can check the official NAACCR documentation to find the NAACCR XML IDs to use in that list. XML IDs are CASE SENSITIVE in the below macro, i.e. “primarysite” will be ignored, whereby “primarySite” will be included in the resulting data set. The code below references the VPR data dictionary, but this line of code could additionally be modified to include other data dictionaries that define non-standard NAACCR data items. If your data file only contains standard data items, that dictionary is not needed. Otherwise, the dictionary should have been provided by the organization that created the XML data file. Dictionaries are usually in XML files, but for technical reasons, the macro expects them in CSV files; the NAACCR XML Tool that is distributed with the macros has an option to load a dictionary and save it as CSV. ************************************************************************************************************/; *** The below code uses the NAACCR VPR submission file, but you can also use the***; *** NAACCR incidence file, or any other NAACCR file that contains the below data***; *** elements per the NAACCR standard. Please be sure that your data dictionary ***; *** (referenced in “dictfile” refers to a CSV version of the data dictionary ***; *** that aligns with the XML file you are referencing in “sourcefile”. ***; %include "R:\EPI\CANCER\NAACCR\DataStandardsAndDictionary\V22\XML_resources\naaccr-xml-utility-9.0\sas\read_naaccr_xml_macro.sas"; %readNaaccrXml( libpath="R:\EPI\CANCER\NAACCR\DataStandardsAndDictionary\V22\XML_resources\naaccr-xml-utility-9.0\sas\naaccr-xml-9.0-sas.jar", sourcefile=/*"R:\EPI\CANCER\Call_For_Data\2022-Nov-Call-for-Data\EXT-01\ID.ext01.20221020111532.all.naaccr.confidential.items.xml.gz",*/ "R:\EPI\CANCER\Call_For_Data\2022-Nov-Call-for-Data\EXT-02\ID.ext02.20221020103929.vpr-2022.xml.gz", naaccrversion="220", recordtype="C", dataset=fromxml, items="patientIdNumber, primarySite, tumorRecordNumber, sequenceNumberCentral, sex, addrAtDxState, addrAtDxPostalCode, countyAtDx, countyAtDxAnalysis, countyAtDxGeocode2010, maritalStatusAtDx, race1, race2, nhiaDerivedHispOrigin, ihsLink, ageAtDiagnosis, dateOfBirth, dateOfDiagnosis, vitalStatus, dateOfLastContact, diagnosticConfirmation, typeOfReportingSource, histologicTypeIcdO3, behaviorCodeIcdO3, grade, gradeClinical, gradePathological, laterality, seerSummaryStage2000, derivedSs2000, summaryStage2018, derivedSummaryStage2018, regionalNodesPositive, regionalNodesExamined, tnmPathT, tnmPathN, tnmPathM, tnmClinT, tnmClinN, tnmClinM, ajccTnmPathT, ajccTnmPathN, ajccTnmPathM, ajccTnmClinT, ajccTnmClinN, ajccTnmClinM, metsAtDxBone, metsAtDxBrain, metsAtDxDistantLn, metsAtDxLiver, metsAtDxLung, metsAtDxOther, csMetsAtDxBone, csMetsAtDxBrain, csMetsAtDxLiver, csMetsAtDxLung, csTumorSize, tumorSizeSummary, csSiteSpecificFactor1, estrogenReceptorPercntPosOrRange, estrogenReceptorSummary, csSiteSpecificFactor2, progesteroneRecepSummary, progesteroneRecepPrcntPosOrRange, csSiteSpecificFactor9, her2IhcSummary, csSiteSpecificFactor11, her2IshSummary, rxSummSurgPrimSite, rxDateSurgery, rxSummRadiation, rxDateRadiation, rxSummChemo, rxDateChemo, rxSummHormone, rxDateHormone, primaryPayerAtDx, figoStage, ajccTnmClinTSuffix, sentinelLymphNodesExamined, sentinelLymphNodesPositive, dateSentinelLymphNodeBiopsy, rxSummScopeRegLnSur, ki67, ca125PretreatmentInterpretation, dateRegionalLNDissection, rxDateMostDefinSurg, totalDose, phase1TotalDose, phase1DosePerFraction, phase1NumberOfFractions, phase2TotalDose, phase2DosePerFraction, phase2NumberOfFractions, phase3TotalDose, phase3DosePerFraction, phase3NumberOfFractions, phase1RadiationTreatmentModality, phase2RadiationTreatmentModality, phase3RadiationTreatmentModality, rxSummBrm, tobaccoUseSmokingStatus, height, weight, censusTrPovertyIndictr", dictfile=/*"R:\EPI\CANCER\Call_For_Data\2022-Nov-Call-for-Data\EXT-01\ID.ext01.20221020111532.all.naaccr.confidential.items.dictionary.220.csv",*/ "R:\EPI\CANCER\Call_For_Data\2022-Nov-Call-for-Data\EXT-02\ID.ext02.20221020103929.vpr-2022-dictionary.csv", cleanupcsv="yes", groupeditems="no" ); proc contents data=fromxml position; run; *** NOTE REGARDING VAR58 Ki-67 Proliferation Index *; *** Coded on lines 1404-1418 *; *** If your data are not continuous, and instead include*; *** "XXX.4", "XXX.5" and "XXX.6", *; *** Please do not use the code below, *; *** which sets these values to '999'/'missing' *; *** Instead please contact the VENUSCANCER team *; *** for assistance on how to code the values *; *** for this field *; *** 3. WHICH COUNTRY IS YOUR CANCER REGISTRY IN? ***; *** UN-COMMENT THE LINE CORRESPONDING TO YOUR COUNTRY, AND COMMENT OUT THE ***; *** OTHER THREE LINES. FOR UNITED STATES, LEAVE DEFAULT CODE. ***; %global VAR1 VAR2 FUPtype NDI_year FirstYear LastYear OutLib C3SiteCode C3SUB fname fstar; %let VAR1 = 1840; /* United States of America */ *%let VAR1 = 5630; /* Puerto Rico */ *%let VAR1 = 9316; /* Guam */ *%let VAR1 = 1124; /* Canada */ *** 4. WHAT IS THE 3-DIGIT REGISTRY CODE (VAR2) THAT WAS PROVIDED TO YOU BY THE ***; *** VENUSCANCER STAFF? INPUT THIS CODE BELOW. IF YOUR CODE HAS A LEADING ZERO, ***; *** USE THE LEADING ZERO. E.G. 010 FOR ALABAMA. ***; %let VAR2 = 130; /* EXAMPLE SHOWN IS FOR Cancer Data Registry of Idaho */ *** 5. DOES YOUR REGISTRY CONDUCT ACTIVE PATIENT FOLLOW-UP (MOSTLY, SEER REGISTRIES) ***; *** OR PASSIVE FOLLOW-UP USING A COMBINATION OF STATE/PROVINCE DEATH CERTIFICATE ***; *** LINKAGES AND NATIONAL DEATH LINKAGES USING EITHER THE US NATIONAL DEATH INDEX ***; *** OR STATS CANADA (CD)? ***; *** IF ACTIVE FOLLOW-UP, THEN COMMENT OUT THE LINE "%let FUPtype = 'Passive'." ***; *** AND UN-COMMENT THE LINE "%let FUPtype = 'Active'" ***; *%let FUPtype = 'Passive'; %let FUPtype = 'Active'; *** 6. FOR REGISTRIES CONDUCTING PASSIVE FOLLOW-UP USING A COMBINATION OF STATE/PROVINCE ***; *** DEATH CERTIFICATE LINKAGES AND NATIONAL DEATH LINKAGES USING EITHER THE NATIONAL ***; *** DEATH INDEX (US) OR STATS CANADA (CD), INPUT THE LATEST YEAR OF NATIONAL DEATH ***; *** DATA THAT YOU HAVE LINKED TO AND UPDATED YOUR DATABASE WITH. ***; *** IN THE US, THIS CANNOT BE LATER THAN 2015 BECAUSE 2015 IS THE LATEST YEAR OF NDI ***; *** DEATHS AVAILABLE AS OF THE TIME OF THE VENUSCANCER DATA SUBMISSION (NDI 2015 EARLY ***; *** RELEASE FILE). ***; *** IF THE LATEST YEAR OF NATIONAL DEATHS LINKED TO IS 2017, USE THE DEFAULT CODE: ***; %let NDI_year = '2020'; *** IF THE LATEST YEAR OF NATIONAL DEATHS LINKED TO IS 2016, USE THIS CODE: ; *%let NDI_year = '2016'; *** IF THE LATEST YEAR OF NATIONAL DEATHS LINKED TO IS EARLIER THAN 2016, USE THAT VALUE FOR NDI_YEAR. *** IF YOU DO NOT LINK TO NATIONAL DEATH DATABASES, USE THIS CODE: *%let NDI_year = ' '; *** 7. WHAT IS THE EARLIEST INCIDENCT YEAR OF CASES THAT YOU WISH TO INCLUDE IN THE FILES ***; *** PROCESSED FOR VENUSCANCER? DEFAULT IS 2018. IF NECESSARY, INPUT A CHANGE INSIDE THE QUOTES BELOW. ***; *** THE MULTIPLE PRIMARY/HISTOLOGY CONVERSION FROM SEER TO IARC/IACR RULES SHOULD USE DATA FROM 1995 FORWARD IF AVAILABLE. ***; *** ONLY CASES DIAGNOSED IN 2015-2018 WILL BE SUBMITTED TO VENUSCANCER. ***; %let FirstYear = '2018'; *** 8. WHAT IS THE LATEST INCIDENCT YEAR OF CASES THAT YOU WISH TO INCLUDE IN THE FILES ***; *** SENT TO VENUSCANCER? DEFAULT IS 2018. IF NECESSARY, INPUT A CHANGE INSIDE THE QUOTES BELOW. ***; %let LastYear = '2018'; *** 9. MODIFY THE PATH THAT WILL BE USED FOR THE OUTPUT FILES THAT WILL BE SUBMITTED TO ***; *** VENUSCANCER. THE FILES AND FILENAMES WILL BE GENERATED AUTOMATICALLY AND WILL ***; *** FOLLOW THE NAMING CONVENTION OF THE VENUSCANCER DOCUMENTS. ***; *** THIS LOCATION WILL ALSO BE USED TO WRITE THE NAACCR V18 FILE THAT YOU ARE TO RUN ***; *** THROUGH GENEDITS PLUS FOR VENUSCANCER AND INTER-RECORD EDITS PRIOR TO SUBMITTING YOUR ***; *** DATA TO VENUSCANCER. THE FILE TO BE USED IN THE EDITS PROGRAMS WILL BE CALLED: ***; *** ForEdits.N18 ***; *** *** NOTE THAT THE \ CHARACTER *** MUST *** APPEAR BEFORE THE TRAILING PARENTHESIS ***; *** *** AS IN THE EXAMPLE BELOW. ***; %let OutLib = %str(R:\EPI\CANCER\External_Data_Requests\CONCORD\VENUSCANCER\NAACCR_to_VENUSCANCER_SAS\V22_to_VENUS\); *** 10. ITERATION OF VENUSCANCER SUBMISSION. IF THIS IS YOUR FIRST SUBMISSION UNDER VENSUSCANCER, ***; *** LEAVE THE DEFAULT VALUE (1) AS SHOWN BELOW. IF THE VENUSCANCER GROUP REQUIRES YOU TO ***; *** RESUBMIT DATA, THEN CODE ACCORDING TO WHAT THEY TELL YOU. ***; %let C3SUB = 1.csv; *%let C3SUB = 2.csv; *** REGISTRIES SHOULD NOT NEED TO MODIFY ANY OF THE CODE BELOW ***; *** REGISTRIES SHOULD RUN EACH STEP OF THE CODE AND REVIEW THE RESULTS, ***; *** ONE STEP AT A TIME. ***; *** STEP 1 - ENSURE THAT VENUS VAR1 AND VAR2 ARE CORRECTLY MAPPED TO ***; *** COUNTRY AND REGISTRY AND ALL MACRO VARIABLES WERE POPULATED CORRECTLY ***; proc format; value $Country '1840' = 'United States of America' '5630' = 'Puerto Rico' '9316' = 'Guam' '1124' = 'Canada'; value $Reg '1124010' = 'Alberta' '1124020' = 'British Columbia' '1124030' = 'Manitoba' '1124040' = 'New Brunswick' '1124050' = 'Newfoundland' '1124060' = 'Northwest Territories' '1124070' = 'Nova Scotia' '1124080' = 'Nunavut' '1124090' = 'Ontario' '1124100' = 'Prince Edward Island' '1124110' = 'Québec' '1124120' = 'Saskatchewan' '1124130' = 'Yukon' '1840010' = 'Alabama' '1840020' = 'Alaska' '1840030' = 'Arizona' '1840040' = 'Arkansas' '1840050' = 'California' '1840051' = 'Greater California' '1840052' = 'Greater Bay Area' '1840053' = 'Los Angeles' '1840060' = 'Colorado' '1840070' = 'Connecticut' '1840080' = 'Delaware' '1840090' = 'District of Columbia' '1840100' = 'Florida' '1840110' = 'Georgia' '1840111' = 'Atlanta' '1840120' = 'Hawaii' '1840130' = 'Idaho' '1840140' = 'Illinois' '1840150' = 'Indiana' '1840160' = 'Iowa' '1840170' = 'Kansas' '1840180' = 'Kentucky' '1840190' = 'Louisiana' '1840200' = 'Maine' '1840210' = 'Maryland' '1840220' = 'Massachusetts' '1840230' = 'Michigan' '1840231' = 'Detroit' '1840240' = 'Minnesota' '1840250' = 'Mississippi' '1840260' = 'Missouri' '1840270' = 'Montana' '1840280' = 'Nebraska' '1840290' = 'Nevada' '1840300' = 'New Hampshire' '1840310' = 'New Jersey' '1840320' = 'New Mexico' '1840330' = 'New York' '1840340' = 'North Carolina' '1840350' = 'North Dakota' '1840360' = 'Ohio' '1840370' = 'Oklahoma' '1840380' = 'Oregon' '1840390' = 'Pennsylvania' '1840400' = 'Rhode Island' '1840410' = 'South Carolina' '1840420' = 'South Dakota' '1840430' = 'Tennessee' '1840440' = 'Texas' '1840450' = 'Utah' '1840460' = 'Vermont' '1840470' = 'Virginia' '1840480' = 'Washington' '1840481' = 'Seattle' '1840490' = 'West Virginia' '1840500' = 'Wisconsin' '1840510' = 'Wyoming' '5630001' = 'Puerto Rico' '9316001' = 'Guam' ; run; %global RegName; data Check_Macro_Vars; country_check = 'YOUR COUNTRY IS: '||put(input(put(&VAR1,z4.),$4.),$Country.); registry_check = 'YOUR REGISTRY IS: '||put(input(put(&VAR1,z4.),$4.)||input(put(&VAR2,z3.),$3.),$Reg.); datayears = 'YOUR DATA COVER '||&FirstYear||' - '||&LastYear||' INCIDENCE YEARS'; FUP_check = 'YOUR REGISTRY CONDUCTS '||&FUPtype||' FOLLOW-UP'; if &FUPtype = 'Passive' then FUP_year = 'AND THE LAST YEAR OF COMPLETE (NATIONAL) DEATH ASCERTAINMENT IN YOUR DATASET IS: '||&NDI_year; if &FUPtype = 'Active' then FUP_year = 'NOT APPLICABLE - ACTIVE FOLLOW-UP'; /* it may still be useful to know last year of complete death clearance - NDI and state */ RegName = input(put(input(put(&VAR1,z4.),$4.)||input(put(&VAR2,z3.),$3.),$Reg.),$50.); call symput('RegName', RegName); run; title1 'TRANSLATING NAACCR V22 FILE TO VENUSCANCER FORMAT'; title2 'MACRO VARIABLE CHECKS'; title3 'IF ANY OF THE INFORMATION IN THIS PRINT IS IN ERROR, STOP!!!'; title4 'AND CHECK MACRO VARIABLE ENTRIES. IF STILL IN ERROR, CONTACT'; title5 'CHRIS JOHNSON (US, cjohnson@teamiha.org) OR BOZENA MORAWSKI (US, bmorawski@teamiha.org).'; proc print data=Check_Macro_Vars noobs; var country_check registry_check datayears FUP_check FUP_year RegName; run; proc contents data = fromxml position ; run ; *** STEP 2 - READ IN NAACCR VARIABLES THAT WILL BE MAPPED TO VENUSCANCER LAYOUT ***; data one; format indexsite $10. ; * infile fromxml /*lrecl = 4048*/ pad missover; /* INCIDENCE */ set fromxml ; keep patientIdNumber ; label patientIdNumber ='20_Patient ID Number'; keep primarysite ; label primarysite ='400_Primary_Site'; keep tumorRecordNumber ; label tumorRecordNumber ='60_Tumor Record Number'; keep sequenceNumberCentral ; label sequenceNumberCentral ='380_Sequence Number--Central'; keep sex ; label sex ='220_Sex'; keep addrAtDxState ; label addrAtDxState ='80_Addr at DX--State'; keep addrAtDxPostalCode ; label addrAtDxPostalCode ='100_Addr at DX--Postal Code (used only for Canada)'; keep countyAtDx ; label countyAtDx ='90_County at DX Reported'; keep countyAtDxAnalysis ; label countyAtDxAnalysis ='89_County at DX Analysis'; keep countyAtDxGeocode2010 ; label countyAtDxGeocode2010 ='96_County at DX Geocode 2010'; keep maritalStatusAtDx ; label maritalStatusAtDx ='150_Marital Status'; keep race1 ; label race1 ='160_Race 1'; keep race2 ; label race2 ='161_Race 2'; keep nhiaDerivedHispOrigin ; label nhiaDerivedHispOrigin ='191_NHIA Derived Hisp Origin'; keep ihsLink ; label ihsLink ='192_IHS Link'; keep ageAtDiagnosis ; label ageAtDiagnosis ='230_Age at Diagnosis'; keep dateOfBirth ; label dateOfBirth ='240_Date of Birth'; keep dateOfDiagnosis ; label dateOfDiagnosis ='390_Date of Diagnosis'; keep vitalStatus ; label vitalStatus ='1760_Vital Status'; keep dateOfLastContact ; label dateOfLastContact ='1750_Date of Last Contact'; keep diagnosticConfirmation ; label diagnosticConfirmation='490_Diagnostic Confirmation'; keep typeOfReportingSource ; label typeOfReportingSource ='500_Type of Reporting Source'; keep histologicTypeIcdO3 ; label histologicTypeIcdO3 ='522_Histologic Type ICD-O-3'; keep behaviorCodeIcdO3 ; label behaviorCodeIcdO3 ='523_Behavior Code ICD-O-3'; keep grade ; label grade ='440_Grade'; keep gradeClinical ; label gradeClinical ='3843_grade Clinical' ; keep gradePathological ; label gradePathological ='3844_grade Pathological' ; keep laterality ; label laterality ='410_Laterality'; keep seerSummaryStage2000 ; label seerSummaryStage2000 ='759_SEER Summary Stage 2000'; keep derivedSs2000 ; label derivedSs2000 ='3020_Derived SS2000'; keep summaryStage2018 ; label summaryStage2018 = '764_SEER Summary Stage 2018' ; keep derivedSummaryStage2018 ; label derivedSummaryStage2018= '762_Derived Summary Stage 2018' ; keep regionalNodesPositive ; label regionalNodesPositive ='820_Regional Nodes Positive'; keep regionalNodesExamined ; label regionalNodesExamined ='830_Regional Nodes Examined'; /* 2015 - 2017 */ keep tnmPathT ; label tnmPathT ='880_TNM Path T'; keep tnmPathN ; label tnmPathN ='890_TNM Path N'; keep tnmPathM ; label tnmPathM ='900_TNM Path M'; keep tnmClinT ; label tnmClinT ='940_TNM Clin T'; keep tnmClinN ; label tnmClinN ='950_TNM Clin N'; keep tnmClinM ; label tnmClinM ='960_TNM Clin M'; /* 2018 */ keep ajccTnmPathT ; label ajccTnmPathT ='1011_ajcc Tnm Path T'; keep ajccTnmPathN ; label ajccTnmPathN ='1012_ajcc Tnm Path N'; keep ajccTnmPathM ; label ajccTnmPathM ='1013_ajcc Tnm Path M'; keep ajccTnmClinT ; label ajccTnmClinT ='1001_ajcc Tnm Clin T'; keep ajccTnmClinN ; label ajccTnmClinN ='1002_ajcc Tnm Clin N'; keep ajccTnmClinM ; label ajccTnmClinM ='1003_ajcc Tnm Clin M'; keep metsAtDxBone ; label metsAtDxBone ='1112_Mets at DX-Bone'; keep metsAtDxBrain ; label metsAtDxBrain ='1113_Mets at DX-Brain'; keep metsAtDxDistantLn ; label metsAtDxDistantLn ='1114_Mets at DX-Distant LN'; keep metsAtDxLiver ; label metsAtDxLiver ='1115_Mets at DX-Liver'; keep metsAtDxLung ; label metsAtDxLung ='1116_Mets at DX-Lung'; keep metsAtDxOther ; label metsAtDxOther ='1117_Mets at DX-Other'; keep csMetsAtDxBone ; label csMetsAtDxBone ='2851_CS Mets at DX-Bone'; keep csMetsAtDxBrain ; label csMetsAtDxBrain ='2852_CS Mets at DX-Brain'; keep csMetsAtDxLiver ; label csMetsAtDxLiver ='2853_CS Mets at DX-Liver'; keep csMetsAtDxLung ; label csMetsAtDxLung ='2854_CS Mets at DX-Lung'; keep csTumorSize ; label csTumorSize ='2800_CS Tumor Size'; keep tumorSizeSummary ; label tumorSizeSummary ='756_Tumor Size Summary'; keep csSiteSpecificFactor1 ; label csSiteSpecificFactor1 ='2880_CS Site Specific Factor 1'; /* Check for PAP results in 2018+ cases */ keep estrogenReceptorPercntPosOrRange ; label estrogenReceptorPercntPosOrRange ='3826_Estrogen Receptor Percnt Pos Or Range'; keep estrogenReceptorSummary ; label estrogenReceptorSummary = '3827_Estrogen Receptor Summary'; keep csSiteSpecificFactor2 ; label csSiteSpecificFactor2 ='2890_CS Site Specific Factor 2'; keep progesteroneRecepSummary ; label progesteroneRecepSummary ='3915_Progesterone Recep Summary'; keep progesteroneRecepPrcntPosOrRange ; label progesteroneRecepPrcntPosOrRange ='3914_Progesterone Recep Prcnt Pos Or Range'; keep csSiteSpecificFactor9 ; label csSiteSpecificFactor9 ='2863_CS Site Specific Factor 9'; keep her2IhcSummary ; label her2IhcSummary ='3850_HER2 Ihc Summary' ; keep csSiteSpecificFactor11 ; label csSiteSpecificFactor11='2865_CS Site Specific Factor 11'; keep her2IshSummary ; label her2IshSummary='3854_HER2 Ish Summary'; keep rxSummSurgPrimSite ; label rxSummSurgPrimSite ='1290_RX Summ--Surg Prim Site'; keep rxDateSurgery ; label rxDateSurgery ='1200_RX Date Surgery'; keep rxSummRadiation ; label rxSummRadiation ='1360_RX Summ--Radiation'; keep rxDateRadiation ; label rxDateRadiation ='1210_RX Date Radiation'; keep rxSummChemo ; label rxSummChemo ='1390_RX Summ--Chemo'; keep rxDateChemo ; label rxDateChemo ='1220_RX Date Chemo'; keep rxSummHormone ; label rxSummHormone ='1400_RX Summ--Hormone'; keep rxDateHormone ; label rxDateHormone ='1230_RX Date Hormone'; keep primaryPayerAtDx ; label primaryPayerAtDx ='630_Primary_Payer_at_DX'; /* New fields for 2018 */ keep figoStage ; label figoStage ='3836_figo_Stage' ; keep ajccTnmClinTSuffix ; label ajccTnmClinTSuffix ='1031_ajcc_Tnm_Clin_T_Suffix' ; /* VAR24 Multifocality */ keep sentinelLymphNodesExamined ; label sentinelLymphNodesExamined ='834_Sentinel_Lymph_Nodes_Examined'; keep sentinelLymphNodesPositive ; label sentinelLymphNodesPositive ='835_Sentinel_Lymph_Nodes_Positive'; /* VAR40 */ keep dateSentinelLymphNodeBiopsy ; label dateSentinelLymphNodeBiopsy ='832_Date_Sentinel_Lymph_Node_Biopsy' ; keep rxSummScopeRegLnSur ; label rxSummScopeRegLnSur ='1292_RX_Summ_Scope_Reg_LN_Sur' ; keep diagnosticConfirmation ; label diagnosticConfirmation ='490_Diagnostic_Confirmation' ; keep ki67 ; label ki67 ='3863_Ki_67' ; keep ca125PretreatmentInterpretation ; label ca125PretreatmentInterpretation ='3818_CA-125_Pretreatment_Interpretation' ; keep dateRegionalLNDissection ; label dateRegionalLNDissection ='682_dateRegional_LN_Dissection' ; keep rxDateMostDefinSurg ; label rxDateMostDefinSurg ='3170_RX_Date_Mst_Defn_Srg' ; keep rxDateSurgery ; label rxDateSurgery ='1200_rx_Date_Surgery' ; keep totalDose ; label totalDose ='1533_Total_Dose' ; keep phase1TotalDose ; label phase1TotalDose ='1507_Phase_I_Total_Dose' ; keep phase1DosePerFraction ; label phase1DosePerFraction ='1501_Phase_I_Dose_per_Fraction' ; keep phase1NumberOfFractions ; label phase1NumberOfFractions ='1503_Phase_I_Number_of_Fractions' ; keep phase2TotalDose ; label phase2TotalDose ='1517_Phase_II_Total_Dose' ; keep phase2DosePerFraction ; label phase2DosePerFraction ='1511_Phase_II_Dose_per_Fraction' ; keep phase2NumberOfFractions ; label phase2NumberOfFractions ='1513_Phase_II_Number_of_Fractions' ; keep phase3TotalDose ; label phase3TotalDose ='1527_Phase_III_Total_Dose' ; keep phase3DosePerFraction ; label phase3DosePerFraction ='1521_Phase_III_Dose_per_Fraction' ; keep phase3NumberOfFractions ; label phase3NumberOfFractions ='1523_Phase_III_Number_of_Fractions' ; keep phase1RadiationTreatmentModality ; label phase1RadiationTreatmentModality='1506_Phase_I_Radiation_Treatment_Modality'; keep phase2RadiationTreatmentModality ; label phase2RadiationTreatmentModality='1516_Phase_II_Radiation_Treatment_Modality'; keep phase3RadiationTreatmentModality ; label phase3RadiationTreatmentModality='1526_Phase_III_Radiation_Treatment_Modality'; keep rxSummBrm ; label rxSummBrm = '1410_RX_Summ_BRM' ; keep her2OverallSummary ; label her2OverallSummary = '3855_HER2_Overall_Summary' ; keep tobaccoUseSmokingStatus ; label tobaccoUseSmokingStatus ='344_Tobacco_Use_Smoking_Status' ; *keep height ; *label height ='XXX_Height' ; *keep weight ; *label weight ='XXX_Weight' ; keep censusTrPovertyIndictr ; label censusTrPovertyIndictr ='145_Census_Tr_Poverty_Indictr' ; *** INDEX SITE CATEGORIES UNDER SEER MP/H RULES ***; if primarySite in ('C500','C501','C502','C503','C504','C505','C506','C508','C509') then indexsite = 'Breast'; else if primarySite in ('C530','C531','C538','C539') then indexsite = 'Cervix'; else if primarySite in ('C480','C481','C482','C488','C569','C570','C571','C572','C573','C574','C577','C578','C579') then indexsite = 'Ovary'; /* Updated 2023-02 to include C48.8 */ keep indexsite ; run; proc contents data = one ; run ; title2 'FREQUENCY DISTRIBUTION OF INDEX CASES UNDER SEER MP/H RULES'; title3; title4; title5; proc freq data=one; format dateOfDiagnosis $4.; where substr(dateOfDiagnosis,1,4) = '2018' and (indexsite ne ' ' ); tables indexsite / missing; tables dateOfDiagnosis * (indexsite) / missing nocol norow nopercent; tables indexsite * sex / missing nocol norow nopercent; tables behaviorCodeIcdO3 * (indexsite) / missing nocol norow nopercent; tables ki67 diagnosticConfirmation figoStage /* csSiteSpecificFactor1 */ estrogenReceptorSummary * (indexsite) estrogenReceptorPercntPosOrRange * (indexsite) progesteroneRecepSummary her2IhcSummary her2IshSummary / missing nocol norow nopercent; run; *** STEP 3 - IMPLEMENT IACR/IARC MULTIPLE PRIMARY AND HISTOLOGY RULES ***; *** THIS SAS CODE PROVIDED BY IMS. PRODUCES RESULTS IDENTICAL TO IARCcrgTOOLS. ***; *** EXCEPT NEWER HISTOLOGY CODES ARE ALSO MAPPED TO HISTOLOGY GROUPS. ***; options mprint; %macro hemat(num); data hemat&num.; set mult; if histgrp=# proc sort; by Registry patientIdNumber histgrp sequenceNumberCentral descending histologicTypeIcdO3; data hemat&num. hematout&num.; set hemat&num.; by Registry patientIdNumber histgrp; if first.histgrp then output hemat&num.; else output hematout&num.; %mend; data iarc; set one; registry = &VAR1||&VAR2; /*N18_380 = sequenceNumberCentral = Sequence Number */ /*N18_523 = behaviorCodeIcdO3 = ICD-O-3 Behavior */ /*N18_20 = patientIdNumber = Patient Id Number */ /*N18_400 = primarySite = Primary Site */ /*N18_522 = histologicTypeIcdO3 = ICD-O-3 Histology */ dx_dy = substr(dateOfDiagnosis,7,2); dx_yr = substr(dateOfDiagnosis,1,4); dx_mo = substr(dateOfDiagnosis,5,2); site3 = substr(primarySite,1,3); proc sort; by registry patientIdNumber sequenceNumberCentral; data check notmalig ; set iarc; by Registry patientIdNumber sequenceNumberCentral; if (behaviorCodeIcdO3 = '2' and not ('C670' <= primarySite <= 'C679')) or behaviorCodeIcdO3 in ('0','1') then output notmalig; /*Removes in situ cases that are not bladder, and benign and borderline cases */ else output check; /*Contains cases that would be processed by the IARC program*/ data notmalig ; set notmalig; newiarc = 9; proc sort; by registry patientIdNumber sequenceNumberCentral; /*Separates cases into those with only one tumor record in the file and those with more than one record. Those with only one record are automatically set to 1.*/ data single mult; set check; by registry patientIdNumber sequenceNumberCentral; if (first.patientIdNumber and last.patientIdNumber) then do; newiarc = 1; output single; end; else output mult; /*These histology groups and site groups are those that are defined by IARC*/ data mult; set mult; newiarc=0; if 8051 <= histologicTypeIcdO3 <= 8084 or 8120 <= histologicTypeIcdO3 <= 8131 then histgrp = 1; else if 8090 <= histologicTypeIcdO3 <= 8110 then histgrp = 2; else if 8140 <= histologicTypeIcdO3 <= 8149 or 8160 <= histologicTypeIcdO3 <= 8162 or 8190 <= histologicTypeIcdO3 <= 8221 or 8260 <= histologicTypeIcdO3 <= 8337 or 8350 <= histologicTypeIcdO3 <= 8551 or 8570 <= histologicTypeIcdO3 <= 8576 or 8940 <= histologicTypeIcdO3 <= 8941 then histgrp =3; else if 8030 <= histologicTypeIcdO3 <= 8046 or 8150 <= histologicTypeIcdO3 <= 8157 or 8170 <= histologicTypeIcdO3 <= 8180 or 8230 <= histologicTypeIcdO3 <= 8255 or 8340 <= histologicTypeIcdO3 <= 8347 or 8560 <= histologicTypeIcdO3 <= 8562 or 8580 <= histologicTypeIcdO3 <= 8671 then histgrp = 4; else if 8010 <= histologicTypeIcdO3 <= 8015 or 8020 <= histologicTypeIcdO3 <= 8022 or histologicTypeIcdO3 = 8050 then histgrp = 5; else if 8680 <= histologicTypeIcdO3 <= 8713 or 8800 <= histologicTypeIcdO3 <= 8921 or 8990 <= histologicTypeIcdO3 <= 8991 or 9040 <= histologicTypeIcdO3 <= 9044 or 9120 <= histologicTypeIcdO3 <= 9125 or 9130 <= histologicTypeIcdO3 <= 9136 or 9141 <= histologicTypeIcdO3 <= 9252 or 9370 <= histologicTypeIcdO3 <= 9373 or 9540 <= histologicTypeIcdO3 <= 9582 then histgrp = 6; else if 9050 <= histologicTypeIcdO3 <= 9055 then histgrp = 7; else if histologicTypeIcdO3 =9840 or 9861 <= histologicTypeIcdO3 <= 9931 or 9945 <= histologicTypeIcdO3 <= 9946 or histologicTypeIcdO3 = 9950 or 9961 <= histologicTypeIcdO3 <= 9967 or 9980 <= histologicTypeIcdO3 <= 9987 or histologicTypeIcdO3 in (9991,9992) then histgrp = 8; else if 9670 <= histologicTypeIcdO3 <= 9699 or 9731 <= histologicTypeIcdO3 <= 9738 or 9761 <= histologicTypeIcdO3 <= 9767 or 9811 <= histologicTypeIcdO3 <= 9818 or 9823 <= histologicTypeIcdO3 <= 9826 or histologicTypeIcdO3 in (9597,9712,9728,9769,9833,9836,9940) then histgrp = 9; else if 9700 <= histologicTypeIcdO3 <= 9724 or histologicTypeIcdO3 in (9726,9729,9768) or 9827 <= histologicTypeIcdO3 <= 9831 or histologicTypeIcdO3 in (9834,9837,9948) then histgrp = 10; else if 9650 <= histologicTypeIcdO3 <= 9667 then histgrp = 11; else if 9740 <= histologicTypeIcdO3 <= 9742 then histgrp = 12; else if 9750 <= histologicTypeIcdO3 <= 9759 then histgrp = 13; else if 9590 <= histologicTypeIcdO3 <= 9591 or histologicTypeIcdO3 in (9596,9725,9727,9760) or 9800 <= histologicTypeIcdO3 <= 9809 or histologicTypeIcdO3 in (9820,9832,9835,9860,9960) or 9965 <= histologicTypeIcdO3 <= 9975 or histologicTypeIcdO3 in (9989) then histgrp = 14; else if histologicTypeIcdO3 = 9140 then histgrp = 15; else if 8720 <= histologicTypeIcdO3 <= 8790 or 8930 <= histologicTypeIcdO3 <= 8936 or 8950 <= histologicTypeIcdO3 <= 8983 or 9000 <= histologicTypeIcdO3 <= 9030 or 9060 <= histologicTypeIcdO3 <= 9110 or 9260 <= histologicTypeIcdO3 <= 9365 or 9380 <= histologicTypeIcdO3 <= 9539 then histgrp = 16; else if 8000 <= histologicTypeIcdO3 <= 8005 then histgrp = 17; if site3 in ('C01','C02') then N18_400grp = 'C02 '; else if site3 in ('C00','C03','C04','C05','C06') then N18_400grp = 'C06 '; else if site3 in ('C09','C10','C12','C13','C14') then N18_400grp = 'C14 '; else if site3 in ('C19','C20') then N18_400grp = 'C20 '; else if site3 in ('C23', 'C24') then N18_400grp = 'C24 '; else if site3 in ('C33', 'C34') then N18_400grp = 'C34 '; else if site3 in ('C40', 'C41') then N18_400grp = 'C41 '; else if site3 in ('C65', 'C66', 'C67','C68') then N18_400grp = 'C68 '; else N18_400grp = site3; dxdate = mdy(dx_mo,dx_dy,dx_yr); proc sort data=mult; by registry patientIdNumber dxdate sequenceNumberCentral histgrp; run; %hemat(8); %hemat(9); %hemat(10); %hemat(11); %hemat(12); %hemat(13); %hemat(14); data hemat; set hemat8 hemat9 hemat10 hemat11 hemat12 hemat13 hemat14; proc sort; by registry patientIdNumber histgrp dxdate sequenceNumberCentral; data hemat hemat_mult; set hemat; by registry patientIdNumber histgrp dxdate sequenceNumberCentral; if (first.patientIdNumber and last.patientIdNumber) then do; newiarc = 1; output hemat; end; else output hemat_mult; proc sort data=hemat_mult; by registry patientIdNumber descending histgrp dxdate sequenceNumberCentral; data hemat_mult; set hemat_mult; by registry patientIdNumber descending histgrp dxdate sequenceNumberCentral; retain unkspec ; if first.patientIdNumber then do; if histgrp = 14 then unkspec = 1; else unkspec = 0; end; data hemat2 hematunk; set hemat_mult; if unkspec = 0 then do; newiarc = 1; output hemat2; end; else if unkspec = 1 then output hematunk; proc sort data=hematunk; by registry patientIdNumber dxdate sequenceNumberCentral; proc freq data=hematunk noprint; tables registry*patientIdNumber/out=numrecs; data hematunk hematunk2; merge hematunk numrecs; by registry patientIdNumber ; if count = 2 then output hematunk; else output hematunk2; proc sort data=hematunk; by registry patientIdNumber dxdate sequenceNumberCentral; data hematunk hematdup; set hematunk; by registry patientIdNumber dxdate sequenceNumberCentral; if first.patientIdNumber then do; newiarc = 1; output hematunk; end; else output hematdup; proc sort data=hematunk2; by registry patientIdNumber dxdate sequenceNumberCentral; data hematunk2 hematdup2; set hematunk2; by registry patientIdNumber dxdate sequenceNumberCentral; retain foundh; if first.patientIdNumber then do; if histgrp = 14 then foundh = 1; else foundh = 0; newiarc = 1; output hematunk2; end; else if histgrp ne 14 and foundh = 1 then do; foundh = 0; output hematdup2; end; else if histgrp = 14 then output hematdup2; else if histgrp ne 14 and foundh ne 1 then do; newiarc = 1; output hematunk2; end; data hemat; set hemat hemat2 hematunk hematdup hematout8 hematout9 hematout10 hematout11 hematout12 hematout13 hematout14 hematunk2 hematdup2; data kaposi; set mult; if histgrp = 15; proc sort data=kaposi; by registry patientIdNumber dxdate sequenceNumberCentral; data kaposi dup1; set kaposi; by registry patientIdNumber dxdate sequenceNumberCentral; if first.patientIdNumber then do; newiarc = 1; output kaposi; end; else output dup1; data rest; set mult; if 8 <= histgrp <= 15 then delete; proc sort; by registry patientIdNumber N18_400grp histgrp dxdate sequenceNumberCentral ; data out1 single2; set rest; by registry patientIdNumber N18_400grp histgrp dxdate sequenceNumberCentral ; if (first.N18_400grp and last.N18_400grp) then do; newiarc=1; output single2; end; else output out1; proc sort data=out1; by registry patientIdNumber N18_400grp descending histgrp; data carc other; set out1; if 1 <= histgrp <= 5 or histgrp = 17 then output carc; else output other; data carc; set carc; if histgrp = 17 then temp_histgrp = 5; else temp_histgrp = histgrp; proc sort data=carc; by registry patientIdNumber N18_400grp descending temp_histgrp; data carc; set carc; by registry patientIdNumber N18_400grp descending temp_histgrp; retain unkcarc; if first.N18_400grp then do; if temp_histgrp = 5 then unkcarc = 1; else unkcarc = 0; end; data unkcarc restcarc; set carc; if unkcarc = 1 then output unkcarc; else output restcarc; proc sort data=unkcarc; by registry patientIdNumber N18_400grp dxdate sequenceNumberCentral; proc freq data=unkcarc noprint; tables registry*patientIdNumber*N18_400grp/out=numrecs; data unkcarc unkcarc2; merge unkcarc numrecs; by registry patientIdNumber N18_400grp; if count = 2 then output unkcarc; else output unkcarc2; data unkcarc ; set unkcarc; by registry patientIdNumber N18_400grp dxdate ; if first.N18_400grp then newiarc = 1; data unkcarc3 single3 unkcarc_dup1; set unkcarc2; by registry patientIdNumber N18_400grp dxdate sequenceNumberCentral; retain found; if first.N18_400grp then do; if temp_histgrp = 5 then found = 1; else found = 0; newiarc = 1; output single3; end; else if temp_histgrp ne 5 and found = 1 then output unkcarc3; else if temp_histgrp = 5 then output unkcarc_dup1; else if temp_histgrp ne 5 and found = 0 then output single3; proc sort data=unkcarc3; by registry patientIdNumber N18_400grp dxdate temp_histgrp ; data unkcarc3 dupcarc ; set unkcarc3; by registry patientIdNumber N18_400grp dxdate temp_histgrp ; first_N18_400grp = first.N18_400grp; last_N18_400grp = last.N18_400grp; first_histgrp = first.temp_histgrp; last_histgrp = last.temp_histgrp; retain l_histgrp; if first.N18_400grp then do; l_histgrp = temp_histgrp; output dupcarc; end; else do; if l_histgrp ne temp_histgrp then do; newiarc = 1; output unkcarc3; end; else output dupcarc; end; data out1; set single3 restcarc other; proc sort; by registry patientIdNumber N18_400grp descending histgrp histologicTypeIcdO3; data out1; set out1; by registry patientIdNumber N18_400grp descending histgrp histologicTypeIcdO3; retain unkspec; if first.N18_400grp then do; if histgrp = 17 then unkspec = 1; else unkspec = 0; end; data unkspec out1; set out1; if unkspec = 1 then output unkspec; else output out1; proc sort data=unkspec; by registry patientIdNumber N18_400grp dxdate descending histologicTypeIcdO3; data unkspec single3 ; set unkspec; by registry patientIdNumber N18_400grp dxdate descending histologicTypeIcdO3; retain founds; if first.N18_400grp then do; if histgrp = 17 then founds = 1; else founds = 0; newiarc = 1; output single3; end; else if histgrp ne 17 and founds = 1 then do; newiarc = 0; output unkspec; end; else if histgrp = 17 then do; newiarc = 0; output unkspec; end; else if histgrp ne 17 and founds ne 1 then do; newiarc = 1; output single3; end; proc sort data=single3; by registry patientIdNumber N18_400grp histgrp dxdate descending histologicTypeIcdO3; data single3 dup3; set single3; by registry patientIdNumber N18_400grp histgrp dxdate descending histologicTypeIcdO3; if first.histgrp then output single3; else do; newiarc =0; output dup3; end; proc sort data=out1; by registry patientIdNumber N18_400grp histgrp dxdate descending histologicTypeIcdO3; data single4 dup2; set out1; by registry patientIdNumber N18_400grp histgrp dxdate descending histologicTypeIcdO3 ; if first.histgrp then do; newiarc = 1; output single4; end; else output dup2; run; *** STEP 4 - SELECT CASES FOR INCLUSION IN VENUSCANCER STUDY ***; data two; format indexsite $10. ; set hemat kaposi dup1 unkspec single2 single3 single4 dup2 single dup3 notmalig unkcarc unkcarc3 dupcarc unkcarc_dup1; if newiarc not in (1,9) then delete; *** DELETE CASES DIAGNOSED BEFORE FIRSTYEAR OR AFTER LASTYEAR ***; if substr(dateOfDiagnosis,1,4) < &FirstYear then delete; if substr(dateOfDiagnosis,1,4) > &LastYear then delete; if indexsite ne ' ' then output; run; title2 'FREQUENCY DISTRIBUTION OF INDEX CASES UNDER IARC/IACR MP/H RULES'; title3; title4; title5; proc freq data=two; format dateOfDiagnosis $4.; tables indexsite / missing; tables dateOfDiagnosis * (indexsite) / missing nocol norow nopercent; tables indexsite * sex / missing nocol norow nopercent; tables behaviorCodeIcdO3 * (indexsite) / missing nocol norow nopercent; run; *** STEP 5 - MAP NAACCR ITEMS TO VENUSCANCER VARIABLES ***; data VENUSCANCER; *length VAR3 $15. VAR4 $10. NDI_year $4.; set two; NDI_year = put(left(&NDI_year),$4.); label VAR1 = 'Country'; VAR1 = input(put(&VAR1,z4.),$4.); label VAR2 = 'Registry'; VAR2 = input(put(&VAR2,z3.),$3.); length VAR3 $15. VAR4 $10. NDI_year $4.; label VAR3 = 'Person Code'; VAR3 = patientIdNumber; label VAR4 = 'Tumour code'; VAR4 = tumorRecordNumber; if VAR4 = ' ' then VAR4 = sequenceNumberCentral; label VAR5 = 'Sex'; if sex in ('1','2') then VAR5 = sex; else if sex not in ('1','2') then VAR5 = '9'; label VAR6 = 'Region'; *** THIS CODE WILL NEED TO BE MODIFIED TO ACCOMMODATE CANADA AND/OR PUERTO RICO REGIONS BELOW REGISTRY ***; *** THIS CODE WILL NEED TO BE MODIFIED IF A US STATE DOES NOT PROVIDE COUNTY CODES ***; if VAR1 = '1840' and countyAtDxGeocode2010 ne '' then VAR6 = put(stfips(addrAtDxState),z2.)||countyAtDxGeocode2010; else if VAR1 = '1840' and countyAtDxAnalysis ne '' then VAR6 = put(stfips(addrAtDxState),z2.)||countyAtDxAnalysis; else if VAR1 = '1840' and countyAtDx ne '' then VAR6 = put(stfips(addrAtDxState),z2.)||countyAtDx; else if VAR1 in ('1124','5630') then VAR6 = '99999'; label VAR7 = 'Race/ethnicity'; *** RACE/ETHNICITY CODED TO 99 FOR CANADA, USES USCS CATEGORIES FOR US, PUERTO RICO, GUAM ***; *** USES NHIA FOR HISPANIC ETHNICITY ***; if VAR1 in ('1124') then VAR7 = '99'; else if VAR1 in ('1840','5630','9316') then do; *** SAS code to create the USCS race categories - sent by Melissa Jim (CDC/IHS) 05Nov2012 ***; *** define seer race recode (w, b, ai/an, api) ***; if race1 = '01' then seerracerec = '1'; *** white ***; else if race1 = '02' then seerracerec = '2'; *** black ***; else if race1 in ('03') then seerracerec = '3'; *** AI/AN ***; else if race1 in ('98') then seerracerec = '5'; *** other unspecified ***; else if race1 = '99' then seerracerec = '9'; *** unknown ***; else if race1 in ('04','05','06','07','08','09','10','11','12','13','14','15','16','17','20','21','22','25','26','27','28', '30','31','32','96','97') then seerracerec = '4'; *** API ***; else seerracerec = ' '; *** if white, check race2 ***; if seerracerec = '1' then do; if race2 = '02' then seerracerec = '2'; *** black ***; else if race2 in ('03') then seerracerec = '3'; *** AI/AN ***; else if race2 in ('04','05','06','07','08','09','10','11','12','13','14','15','16','17','20','21','22','25','26','27','28', '30','31','32','96','97') then seerracerec = '4'; *** API ***; end; *** if white, check ihslink ***; if addrAtDxState in ('AL','AZ','AR','CA','CO','DE','DC','FL','GA','ID','IL','IN','KS', 'KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ', 'NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','VT','VA', 'WA','WV','WI','WY') then do; if seerracerec in ('1','5','9') & ihsLink = '1' then seerracerec = '3'; end; if seerracerec = '1' and nhiaDerivedHispOrigin in ('1','2','3','4','5','6','7','8') then VAR7 = '01'; else if seerracerec = '1' and nhiaDerivedHispOrigin in ('0') then VAR7 = '02'; else if seerracerec = '1' and nhiaDerivedHispOrigin in (' ') then VAR7 = '03'; else if seerracerec = '2' and nhiaDerivedHispOrigin in ('1','2','3','4','5','6','7','8') then VAR7 = '04'; else if seerracerec = '2' and nhiaDerivedHispOrigin in ('0') then VAR7 = '05'; else if seerracerec = '2' and nhiaDerivedHispOrigin in (' ') then VAR7 = '06'; else if seerracerec = '4' and nhiaDerivedHispOrigin in ('1','2','3','4','5','6','7','8') then VAR7 = '07'; else if seerracerec = '4' and nhiaDerivedHispOrigin in ('0') then VAR7 = '08'; else if seerracerec = '4' and nhiaDerivedHispOrigin in (' ') then VAR7 = '09'; else if seerracerec = '3' and nhiaDerivedHispOrigin in ('1','2','3','4','5','6','7','8') then VAR7 = '10'; else if seerracerec = '3' and nhiaDerivedHispOrigin in ('0') then VAR7 = '11'; else if seerracerec = '3' and nhiaDerivedHispOrigin in (' ') then VAR7 = '12'; else if seerracerec in ('5','9',' ') and nhiaDerivedHispOrigin in ('1','2','3','4','5','6','7','8') then VAR7 = '13'; else if seerracerec in ('5','9',' ') and nhiaDerivedHispOrigin in ('0') then VAR7 = '14'; else if seerracerec in ('5','9',' ') and nhiaDerivedHispOrigin in (' ') then VAR7 = '15'; end; if VAR7 = '' then VAR7 = '99'; label VAR8 = 'Day of birth'; label VAR9 = 'Month of birth'; label VAR10 = 'Year of birth'; VAR8 = substr(dateOfBirth,7,2); /* Updated per conversation with CA 2023-03-20 */ VAR9 = substr(dateOfBirth,5,2); VAR10 = substr(dateOfBirth,1,4); if VAR8 = ' ' then VAR8 = '99'; if VAR9 = ' ' then VAR9 = '99'; if VAR10 = ' ' then VAR10 = '9999'; label VAR11 = 'Day of diagnosis'; label VAR12 = 'Month of diagnosis'; label VAR13 = 'Year of diagnosis'; VAR11 = substr(dateOfDiagnosis,7,2); VAR12 = substr(dateOfDiagnosis,5,2); VAR13 = substr(dateOfDiagnosis,1,4); if VAR11 = ' ' then VAR11 = '99'; if VAR12 = ' ' then VAR12 = '99'; if VAR13 = ' ' then VAR13 = '9999'; if VAR13 < '2015' then delete; *** VENUSCANCER IS REQUESTING CASES DIAGNOSED 2015 AND LATER ***; if substr(dateOfLastContact,1,4) > &NDI_Year then do; *** set cut-off date to last NDI year***; vitalStatus = '1'; dateOfLastContact = &NDI_YEAR||'1231'; end; label VAR14 = 'Last known vital status'; if &FUPtype = 'Passive' then do; if vitalStatus in ('0') then VAR14 = '2'; else if vitalStatus in ('1') then VAR14 = '1'; else VAR14 = '9'; end; else if &FUPtype = 'Active' then do; if vitalStatus in ('0') then VAR14 = '2'; else if vitalStatus in ('1') and length(dateOfLastContact) = 8 and dateOfLastContact < &NDI_year||'1231' then VAR14 = '3'; else if vitalStatus in ('1') and length(dateOfLastContact) = 6 and dateOfLastContact < &NDI_year||'12' then VAR14 = '3'; else if vitalStatus in ('1') and length(dateOfLastContact) = 4 and dateOfLastContact < &NDI_year then VAR14 = '3'; else if vitalStatus in ('1') and length(dateOfLastContact) = 8 and dateOfLastContact >= &NDI_year||'1231' then VAR14 = '1'; else if vitalStatus in ('1') and length(dateOfLastContact) = 6 and dateOfLastContact >= &NDI_year||'12' then VAR14 = '1'; else if vitalStatus in ('1') and length(dateOfLastContact) = 4 and dateOfLastContact >= &NDI_year then VAR14 = '1'; else VAR14 = '9'; end; *** NEED TO CHECK LOGIC FOR VAR14=3 WHEN DATE OF LAST CONTACT IS NOT A COMPLETE DATE ***; *** CANADIAN REGISTRIES MAY NEED TO ADDRESS 'DATE OF DEATH - CANADA' ***; *** FOR US REGISTRIES CONDUCTING PASSIVE FOLLOW-UP, CASES INELIGIBLE FOR NDI LINKAGE COULD BE *** CODED AS '9', BUT WE WOULD NEED TO USE A CONFIDENTIAL LAYOUT AS INPUT. ***; *** IF A REGISTRY PERFORMING ACTIVE FOLLOW UP HAS FOLLOW-UP THROUGH DATE DIFFERENT THAN 20171231, ABOVE *** CODE SHOULD BE MODIFIED TO REFLECT THAT DATE (E.G., COULD BE 20161231 OR 20181231). ***; label VAR15 = 'Day of last known vital status'; label VAR16 = 'Month of last known vital status'; label VAR17 = 'Year of last known vital status'; if vitalStatus in ('0') then do; VAR15 = substr(dateOfLastContact,7,2); VAR16 = substr(dateOfLastContact,5,2); VAR17 = substr(dateOfLastContact,1,4); end; else if vitalStatus = '1' and &FUPtype = 'Passive' then do; if length(dateOfLastContact)<=4 then dateOfLastContact = left(max(substr(dateOfLastContact,1,4),NDI_year)); else if length(dateOfLastContact) =6 then dateOfLastContact = left(max(substr(dateOfLastContact,1,6),(NDI_year||'12'))); else if length(dateOfLastContact) =8 then dateOfLastContact = left(max(dateOfLastContact,(NDI_year||'1231'))); if (dateOfLastContact = NDI_year) or (dateOfLastContact = (NDI_year||'12')) then dateOfLastContact = NDI_year||'1231'; VAR15 = substr(dateOfLastContact,7,2); VAR16 = substr(dateOfLastContact,5,2); VAR17 = substr(dateOfLastContact,1,4); end; else if vitalStatus = '1' and &FUPtype = 'Active' then do; VAR15 = substr(dateOfLastContact,7,2); VAR16 = substr(dateOfLastContact,5,2); VAR17 = substr(dateOfLastContact,1,4); end; if VAR15 = ' ' then VAR15 = '99'; if VAR16 = ' ' then VAR16 = '99'; if VAR17 = ' ' then VAR17 = '9999'; label VAR18 = 'Basis of diagnosis'; if typeOfReportingSource = '6' then VAR18 = '8'; else if typeOfReportingSource = '7' then VAR18 = '7'; else if diagnosticConfirmation = '2' then VAR18 = '4'; else if diagnosticConfirmation in ('1','3') then VAR18 = '5'; else if diagnosticConfirmation = '4' then VAR18 = '6'; else if diagnosticConfirmation in ('5') then VAR18 = '1'; else if diagnosticConfirmation in ('6','7') then VAR18 = '2'; else if diagnosticConfirmation = '8' then VAR18 = '1'; else if diagnosticConfirmation = '9' then VAR18 = '9'; else VAR18 = '9'; label VAR19 = 'ICD-O-3 Topography'; VAR19 = primarySite; label VAR20 = 'ICD-O-3 Morphology'; VAR20 = histologicTypeIcdO3; label VAR21 = 'Behaviour'; VAR21 = behaviorCodeIcdO3; label VAR22 = 'GRADE'; if VAR13 in ('2015','2016','2017') then do; VAR22 = grade; end; if VAR13 = '2018' and indexsite in ('Breast') then do; /* Added for 2018 tumors, new fields in V22 */ if gradePathological in ('1','A') then VAR22 = '1' ; /* A = Well differentiated */ /*Done-2023*/ else if gradePathological in ('2','B') then VAR22 = '2' ; /* B = Moderately differentiated */ else if gradePathological in ('3','C') then VAR22 = '3' ; /* C = Poorly differentiated */ else if gradePathological in ('D') then VAR22 = '4' ; /* D = Undifferentiated, anaplastic */ else if gradePathological in ('L','M','H') then VAR22 = '9'; /* In situ */ else if gradeClinical in ('1','A') then VAR22 = '1' ; /* A = Well differentiated */ else if gradeClinical in ('2','B') then VAR22 = '2' ; /* B = Moderately differentiated */ else if gradeClinical in ('3','C') then VAR22 = '3' ; /* C = Poorly differentiated */ else if gradeClinical in ('D') then VAR22 = '4' ; /* D = Undifferentiated, anaplastic */ else if gradeClinical in ('L','M','H') then VAR22 = '9'; /* In situ */ else VAR22 = '9' ; end; if VAR13 = '2018' and indexsite in ('Cervix') then do; if gradePathological in ('1') then VAR22 = '1' ; /* A = Well differentiated */ /*Done-2023*/ else if gradePathological in ('2') then VAR22 = '2' ; /* B = Moderately differentiated */ else if gradePathological in ('3') then VAR22 = '3' ; /* C = Poorly differentiated */ else if gradeClinical in ('1') then VAR22 = '1' ; /* A = Well differentiated */ else if gradeClinical in ('2') then VAR22 = '2' ; /* B = Moderately differentiated */ else if gradeClinical in ('3') then VAR22 = '3' ; /* C = Poorly differentiated */ else VAR22 = '9' ; end; if VAR13 = '2018' and indexsite in ('Ovary') and primarySite in ('C480','C481','C571') then do; if gradePathological in ('1','A') then VAR22 = '1' ; /* A = Well differentiated */ /*Done-2023*/ else if gradePathological in ('2','B','L') then VAR22 = '2' ; /* B = Moderately differentiated */ else if gradePathological in ('3','C') then VAR22 = '3' ; /* C = Poorly differentiated */ else if gradePathological in ('H','D') then VAR22 = '4' ; /* D = Undifferentiated, anaplastic */ else if gradeClinical in ('1','A') then VAR22 = '1' ; /* A = Well differentiated */ else if gradeClinical in ('2','B','L') then VAR22 = '2' ; /* B = Moderately differentiated */ else if gradeClinical in ('3','C') then VAR22 = '3' ; /* C = Poorly differentiated */ else if gradeClinical in ('H','D') then VAR22 = '4' ; /* D = Undifferentiated, anaplastic */ else VAR22 = '9' ; end ; if VAR13 = '2018' and indexsite in ('Ovary') and primarySite in ('C482','C488','C569','C570') then do; if gradePathological in ('1') then VAR22 = '1' ; /* A = Well differentiated */ /*Done-2023*/ else if gradePathological in ('2','L') then VAR22 = '2' ; /* B = Moderately differentiated */ else if gradePathological in ('3') then VAR22 = '3' ; /* C = Poorly differentiated */ else if gradePathological in ('H') then VAR22 = '4' ; /* D = Undifferentiated, anaplastic */ else if gradeClinical in ('1') then VAR22 = '1' ; /* A = Well differentiated */ else if gradeClinical in ('2','L') then VAR22 = '2' ; /* B = Moderately differentiated */ else if gradeClinical in ('3') then VAR22 = '3' ; /* C = Poorly differentiated */ else if gradeClinical in ('H') then VAR22 = '4' ; /* D = Undifferentiated, anaplastic */ else VAR22 = '9' ; end; if VAR13 = '2018' and indexsite in ('Ovary') and primarySite in ('C572','C573','C574','C577','C578','C579') then do; if gradePathological in ('1','A') then VAR22 = '1' ; /* A = Well differentiated */ /*Done-2023*/ else if gradePathological in ('2','B') then VAR22 = '2' ; /* B = Moderately differentiated */ else if gradePathological in ('3','C') then VAR22 = '3' ; /* C = Poorly differentiated */ else if gradePathological in ('D') then VAR22 = '4' ; /* D = Undifferentiated, anaplastic */ else if gradeClinical in ('1','A') then VAR22 = '1' ; /* A = Well differentiated */ else if gradeClinical in ('2','B') then VAR22 = '2' ; /* B = Moderately differentiated */ else if gradeClinical in ('3','C') then VAR22 = '3' ; /* C = Poorly differentiated */ else if gradeClinical in ('D') then VAR22 = '4' ; /* D = Undifferentiated, anaplastic */ else VAR22 = '9' ; end ; label VAR23 = 'CIN grade'; VAR23 = '9'; label VAR24 = 'Multifocality'; /* Added for 2018 tumors, new field in V18 */ if VAR13 = '2018' then do; if ajccTnmClinTSuffix = '(m)' then VAR24 = '1'; else VAR24 = '9'; end; if VAR24 = '' then VAR24 = '9' ; label VAR25 = 'Laterality'; if indexsite = 'Cervix' then VAR25 = '9'; else if laterality in ('1','2') then VAR25 = laterality; else if laterality in ('0','3','5','9') then VAR25 = '9'; else if laterality = '4' then VAR25 = '3'; label VAR26 = 'Screen-detected'; VAR26 = '9'; /* 2015 - 2017 cases */ if VAR13 in ('2015','2016','2017') then do; label VAR27 = 'Pathologic T'; if substr(tnmPathT,1,1) in ('c','p') then tnmPathT = substr(tnmPathT,2,3); if tnmPathT in ('X',' ','88') then VAR27 = '9'; else if tnmPathT in ('0') then VAR27 = '0'; else if tnmPathT in ('IS') then VAR27 = '8'; else if tnmPathT in ('1','1A','1A1','1A2','1B','1B1','1B2', '1C','1M','1MI') then VAR27 = '1'; else if tnmPathT in ('2','2A','2A1','2A2','2B','2C') then VAR27 = '2'; else if tnmPathT in ('3','3A','3B','3C') then VAR27 = '3'; else if tnmPathT in ('4','4A','4B','4C','4D') then VAR27 = '4'; else VAR27 = '9'; label VAR28 = 'Pathologic N'; if substr(tnmPathN,1,1) in ('c','p') then tnmPathN = substr(tnmPathN,2,3); if tnmPathN in ('X',' ','88') then VAR28 = '9'; else if tnmPathN in ('0','0I','0I-','0I+','0M','0M-','0M+','I+','I-') then VAR28 = '0'; else if tnmPathN in ('1','1A','1B','1C','1M','1MI') then VAR28 = '1'; else if tnmPathN in ('2','2A','2B') then VAR28 = '2'; else if tnmPathN in ('3','3A','3B','3C') then VAR28 = '3'; label VAR29 = 'Pathologic M'; if substr(tnmPathM,1,1) in ('c','p') then tnmPathM = substr(tnmPathM,2,3); if tnmPathM in ('X',' ','88') then VAR29 = '9'; else if tnmPathM in ('1','1A','1B','1C') then VAR29 = '1'; else VAR29 = '9'; label VAR30 = 'Clinical T'; if substr(tnmClinT,1,1) in ('c','p') then tnmClinT = substr(tnmClinT,2,3); if tnmClinT in ('X',' ','88') then VAR30 = '9'; else if tnmClinT in ('0') then VAR30 = '0'; else if tnmClinT in ('IS') then VAR30 = '8'; else if tnmClinT in ('1','1A','1A1','1A2','1B','1B1','1B2', '1C','1M','1MI','1MIC') then VAR30 = '1'; else if tnmClinT in ('2','2A','2A1','2A2','2B','2C') then VAR30 = '2'; else if tnmClinT in ('3','3A','3B','3C') then VAR30 = '3'; else if tnmClinT in ('4','4A','4B','4C','4D') then VAR30 = '4'; else VAR30 = '9'; label VAR31 = 'Clinical N'; if substr(tnmClinN,1,1) in ('c','p') then tnmClinN = substr(tnmClinN,2,3); if tnmClinN in ('X',' ','88') then VAR31 = '9'; else if tnmClinN in ('0','0I','0I-','0I+','0M-','0M+') then VAR31 = '0'; else if tnmClinN in ('1','1A','1B','1C','1MI') then VAR31 = '1'; else if tnmClinN in ('2','2A','2B') then VAR31 = '2'; else if tnmClinN in ('3','3A','3B','3C') then VAR31 = '3'; else VAR31 = '9'; label VAR32 = 'Clinical M'; if substr(tnmClinM,1,1) in ('c','p') then tnmClinM = substr(tnmClinM,2,3); if tnmClinM in ('X',' ','88') then VAR32 = '9'; else if tnmClinM in ('0','0+') then VAR32 = '0'; else if tnmClinM in ('1','1A','1B','1C') then VAR32 = '1'; else VAR32 = '9'; end ; /* 2018 cases 8th Edition */ /* Added for 2018 tumors, new fields in V22 */ if VAR13 = '2018' then do; label VAR27 = 'Pathologic T'; /*Done-2022*/ if substr(ajccTnmPathT,1,2) in ('cT','pT') then ajccTnmPathT = substr(ajccTnmPathT,3,8); if ajccTnmPathT in ('X',' ','88') then VAR27 = '9'; else if ajccTnmPathT in ('0') then VAR27 = '0'; else if ajccTnmPathT in ('is(DCIS)','is(Paget') then VAR27 = '8'; else if ajccTnmPathT in ('1','1a','1a1','1a2','1b','1b1','1b2', '1c','1c1','1c2','1c3','1mi') then VAR27 = '1'; else if ajccTnmPathT in ('2','2a','2a1','2a2','2b') then VAR27 = '2'; else if ajccTnmPathT in ('3','3a','3b','3c') then VAR27 = '3'; else if ajccTnmPathT in ('4','4a','4b','4c','4d') then VAR27 = '4'; else VAR27 = '9'; label VAR28 = 'Pathologic N'; /*Done-2022*/ if substr(ajccTnmPathN,1,2) in ('cN','pN') then ajccTnmPathN = substr(ajccTnmPathN,3,5); if ajccTnmPathN in ('X',' ','88') then VAR28 = '9'; else if ajccTnmPathN in ('0','0(i+)','0(mol+)') then VAR28 = '0'; else if ajccTnmPathN in ('1','1a','1b','1c','1mi') then VAR28 = '1'; else if ajccTnmPathN in ('2','2a','2b') then VAR28 = '2'; else if ajccTnmPathN in ('3','3a','3b','3c') then VAR28 = '3'; label VAR29 = 'Pathologic M'; /*Done-2022*/ if substr(ajccTnmPathM,1,2) in ('cM','pM') then ajccTnmPathM = substr(ajccTnmPathM,3,5); if ajccTnmPathM in ('X',' ','88') then VAR29 = '9'; else if ajccTnmPathM in ('0','0(i+)') then VAR29 = '0'; else if ajccTnmPathM in ('1','1a','1b') then VAR29 = '1'; else VAR29 = '9'; label VAR30 = 'Clinical T'; /*Done-2022*/ if substr(ajccTnmClinT,1,2) in ('cT','pT') then ajccTnmClinT = substr(ajccTnmClinT,3,8); if ajccTnmClinT in ('X',' ','88') then VAR30 = '9'; else if ajccTnmClinT in ('0') then VAR30 = '0'; else if ajccTnmClinT in ('is(DCIS)','is(Paget') then VAR30 = '8'; else if ajccTnmClinT in ('1','1a','1a1','1a2','1b','1b1','1b2', '1c','1c1','1c2','1c3','1mi') then VAR30 = '1'; else if ajccTnmClinT in ('2','2a','2a1','2a2','2b') then VAR30 = '2'; else if ajccTnmClinT in ('3','3a','3b','3c') then VAR30 = '3'; else if ajccTnmClinT in ('4','4a','4b','4c','4d') then VAR30 = '4'; else VAR30 = '9'; label VAR31 = 'Clinical N'; /*Done-2022*/ if substr(ajccTnmClinN,1,2) in ('cN','pN') then ajccTnmClinN = substr(ajccTnmClinN,3,5); if ajccTnmClinN in ('X',' ','88') then VAR31 = '9'; else if ajccTnmClinN in ('0','0(i+)') then VAR31 = '0'; else if ajccTnmClinN in ('1','1a','1b','1mi') then VAR31 = '1'; else if ajccTnmClinN in ('2','2a','2b') then VAR31 = '2'; else if ajccTnmClinN in ('3','3a','3b','3c') then VAR31 = '3'; else VAR31 = '9'; label VAR32 = 'Clinical M'; /*Done-2022*/ if substr(ajccTnmClinM,1,2) in ('cM','pM') then ajccTnmClinM = substr(ajccTnmClinM,3,5); if ajccTnmClinM in ('X',' ','88') then VAR32 = '9'; else if ajccTnmClinM in ('0','0(i+)') then VAR32 = '0'; else if ajccTnmClinM in ('1','1a','1b') then VAR32 = '1'; else VAR32 = '9'; end ; label VAR33 ='Site of metastasis'; if VAR13 = '2015' then do; if csMetsAtDxBrain = '1' then VAR33 = '1'; else if csMetsAtDxLiver = '1' or csMetsAtDxLung = '1' then VAR33 = '2'; else if csMetsAtDxBone = '1' then VAR33 = '3'; else VAR33 = '9'; end; if VAR13 > '2015' then do; if metsAtDxBrain = '1' then VAR33 = '1'; else if metsAtDxLiver = '1' or metsAtDxLung = '1' then VAR33 = '2'; else if metsAtDxBone = '1' or metsAtDxDistantLn = '1' then VAR33 = '3'; else VAR33 = '9'; end; if indexsite ne 'Breast' then VAR33 = '9'; label VAR34 = 'SEER Summary Stage 2000'; if VAR13 in ('2015','2016','2017') then do; if VAR18 in ('7','8') then VAR34 = '9'; else if derivedSs2000 = ' ' then VAR34 = seerSummaryStage2000; else VAR34 = derivedSs2000; end ; if VAR13 = '2018' then do; /* Added for 2018 tumors, new fields in V22 */ if VAR18 in ('7','8') then VAR34 = '9'; else if derivedSummaryStage2018 = '' then VAR34 = summaryStage2018; else if VAR34 = '' AND derivedSummaryStage2018 NE '8' then VAR34 = derivedSummaryStage2018 ; else VAR34 = '9' ; end ; label VAR35 = 'Condensed T'; VAR35 = '9'; label VAR36 = 'Condensed N'; VAR36 = '9'; label VAR37 = 'Condensed M'; VAR37 = '9'; label VAR38 = 'FIGO stage'; /* Added for 2018 tumors, new field in V18 */ if indexsite in ('Cervix') then do ; if substr(figoStage,1,1) = '1' then VAR38 = '1' ; else if substr(figoStage,1,1) = '2' then VAR38 = '2' ; else if substr(figoStage,1,1) = '3' then VAR38 = '3' ; else if figoStage in ('4','4A') then VAR38 = '4' ; else if figoStage = '4B' then VAR38 = '5' ; else if figoStage = '97' then VAR38 = '0' ; else VAR38 = '9' ; end ; if indexsite in ('Ovary') then do ; if substr(figoStage,1,1) = '1' then VAR38 = '1' ; else if substr(figoStage,1,1) = '2' then VAR38 = '2' ; else if substr(figoStage,1,1) = '3' then VAR38 = '3' ; else if substr(figoStage,1,1) = '4' then VAR38 = '4' ; else if figoStage = '97' then VAR38 = '0' ; else VAR38 = '9' ; end ; else if indexsite in ('Breast') then VAR38 = '9' ; label VAR39 = 'Tumour size'; if ('001' le csTumorSize and csTumorSize le '300') then VAR39 = csTumorSize; else if ('001' le tumorSizeSummary and tumorSizeSummary le '300') then VAR39 = tumorSizeSummary; else VAR39 = '999'; label VAR40 = 'Sentinel lymph node biopsy'; /* Added for 2018 tumors, new field in V18 */ if rxSummScopeRegLnSur in ('1','2','3','4','5','6','7') OR dateSentinelLymphNodeBiopsy NE '' then VAR40 = '1' ; else if rxSummScopeRegLnSur = '0' then VAR40 = '2' ; else VAR40 = '9'; label VAR41 = 'Number lymph nodes examined'; if ('00' le regionalNodesExamined and regionalNodesExamined le '90') then VAR41 = regionalNodesExamined; else VAR41 = '99'; label VAR42 = 'Number lymph nodes involved'; if ('00' le regionalNodesPositive and regionalNodesPositive le '90') then VAR42 = regionalNodesPositive; else VAR42 = '99'; label VAR43 = 'Mammography'; VAR43 = '9'; label VAR44 = 'Tissue diagnosis'; VAR44 = '9'; label VAR45 = 'Papanicolaou (PAP) test'; VAR45 = '9'; label VAR46 = 'HPV Test'; VAR46 ='9'; label VAR47 = 'Colposcopy'; VAR47 = '9'; label VAR48 = 'Chest x-ray'; VAR48 = '9'; label VAR49 = 'Abdominal ultrasound'; VAR49 = '9'; label VAR50 = 'Scintigraphy'; VAR50 = '9'; label VAR51 = 'Skeletal x-ray'; VAR51 = '9'; label VAR52 = 'Computerised Tomography (CT) scan'; VAR52 = '9'; label VAR53 = 'Trans-vaginal ultrasound'; VAR53 = '9'; label VAR54 = 'Oestrogen (Estrogen) receptors'; if VAR13 in ('2015','2016','2017') and indexsite = 'Breast' then do; if csSiteSpecificFactor1 = '010' then VAR54 = '1'; else if csSiteSpecificFactor1 = '020' then VAR54 = '2'; else if csSiteSpecificFactor1 = '998' then VAR54 = '3'; else VAR54 = '9'; end; if VAR13 in ('2018') and indexsite = 'Breast' then do; /* Added for 2018 tumors, new fields in V22 */ if estrogenReceptorSummary = '1' OR (estrogenReceptorPercntPosOrRange >= '001' AND estrogenReceptorPercntPosOrRange <= '100') OR estrogenReceptorPercntPosOrRange in ('R10','R20','R30','R40','R50','R60','R70','R80','R90','R99') then VAR54 = '2'; else if estrogenReceptorSummary = '0' OR estrogenReceptorPercntPosOrRange = '000' then VAR54 = '1'; else if estrogenReceptorPercntPosOrRange = 'XX8' then VAR54 = '3'; else VAR54 = '9'; end; else VAR54 = '9'; label VAR55 = 'Progesterone receptors'; if VAR13 in ('2015','2016','2017') and indexsite = 'Breast' then do; if csSiteSpecificFactor2 = '010' then VAR55 = '1'; else if csSiteSpecificFactor2 = '020' then VAR55 = '2'; else if csSiteSpecificFactor2 = '998' then VAR55 = '3'; else VAR55 = '9'; end; if VAR13 in ('2018') and indexsite = 'Breast' then do; /* Added for 2018 tumors, new fields in V22 */ if progesteroneRecepSummary = '1' OR (progesteroneRecepPrcntPosOrRange >= '001' AND progesteroneRecepPrcntPosOrRange <= '100') OR progesteroneRecepPrcntPosOrRange in ('R10','R20','R30','R40','R50','R60','R70','R80','R90','R99') then VAR55 = '2'; else if progesteroneRecepSummary = '0' OR progesteroneRecepPrcntPosOrRange = '000' then VAR55 = '1'; else if progesteroneRecepPrcntPosOrRange = 'XX8' then VAR55 = '3'; else VAR55 = '9'; end; else VAR55 = '9'; label VAR56 = 'HER-2 based on immunohistochemistry (IHC) assay'; if VAR13 in ('2015','2016','2017') and indexsite = 'Breast' then do; if csSiteSpecificFactor9 = '020' then VAR56 = '1'; else if csSiteSpecificFactor9 = '030' then VAR56 = '2'; else if csSiteSpecificFactor9 = '010' then VAR56 = '3'; else if csSiteSpecificFactor9 = '998' then VAR56 = '4'; else VAR56 = '9'; end; if VAR13 in ('2018') and indexsite = 'Breast' then do; /* Added for 2018 tumors, new fields in V22 */ if her2IhcSummary in ('0','1','4') then VAR56 = '1'; /* Negative */ else if her2IhcSummary in ('2') then VAR56 = '2'; /* Equivocal */ else if her2IhcSummary in ('3') then VAR56 = '3'; /* Positive */ else if her2IhcSummary in ('8') then VAR56 = '4'; /* Positive */ else VAR56 = '9'; end; else VAR56 = '9'; label VAR57 = 'HER-2 based on immunofluorescence (FISH) assay'; if VAR13 in ('2015','2016','2017') and indexsite = 'Breast' then do; if csSiteSpecificFactor11 = '020' then VAR57 = '1'; else if csSiteSpecificFactor11 = '030' then VAR57 = '2'; else if csSiteSpecificFactor11 = '010' then VAR57 = '3'; else if csSiteSpecificFactor11 = '998' then VAR57 = '4'; else VAR57 = '9'; end; if VAR13 in ('2018') and indexsite = 'Breast' then do; /* Added for 2018 tumors, new fields in V22 */ if her2IshSummary = '0' then VAR57 = '1'; else if her2IshSummary = '2' then VAR57 = '2'; else if her2IshSummary = '3' then VAR57 = '3'; else if her2IshSummary = '8' then VAR57 = '4'; else VAR57 = '9'; end; else VAR57 = '9'; label VAR58 = 'Ki-67 proliferation index'; /* Added for 2018 tumors, new field in V18 */ /* If your data are not continuous, and instead include "XXX.4", "XXX.5" and "XXX.6", */ /* please do not use the code below, which sets these values to '999'/missing and */ /* and instead please contact the VENUSCANCER team for further advice on how to code the values for this field */ length VAR58 $3. ; ki671 = ki67 ; if ki67 in ('XXX.7','XXX.9') then ki671 = '' ; ki6712 = trim(put(round(ki671+0),Z3.)) ; if ki6712 NE '' then VAR58 = ki6712 ; if ki67 in ('XXX.4') then VAR58 = '999' ; /* Categorical response option in original data of "Less than 3%" */ if ki67 in ('XXX.5') then VAR58 = '999' ; /* Categorical response option in original data of "Ki-67 stated as 3%-20%" */ if ki67 in ('XXX.6') then VAR58 = '999' ; /* Categorical response option in original data of "Ki-67 stated as greater than 20%" */ if ki67 in ('XXX.7','XXX.8','XXX.9','') then VAR58 = '999' ; label VAR59 = 'CA-125'; /* Added for 2018 tumors, new field in V18 */ if indexsite = 'Ovary' then do; if ca125PretreatmentInterpretation in ('0','1','2') then VAR59 = '1' ; else if ca125PretreatmentInterpretation in ('7','8','9','') then VAR59 = '9' ; end ; if indexsite NE 'Ovary' then VAR59 = '9' ; label VAR60 = 'BRCA-1 or BRCA-2'; VAR60 = '9'; label VAR61 = 'Emergency presentation'; VAR61 = '9'; label VAR62 = 'Cancer-directed surgery'; if rxSummSurgPrimSite = '00' then VAR62 = '2'; else if ('10' le rxSummSurgPrimSite and rxSummSurgPrimSite le '98') then VAR62 = '1'; else VAR62 = '9'; label VAR63 = 'Day of surgery'; label VAR64 = 'Month of surgery'; label VAR65 = 'Year of surgery'; VAR63 = substr(rxDateSurgery,7,2); VAR64 = substr(rxDateSurgery,5,2); VAR65 = substr(rxDateSurgery,1,4); if VAR62 ne '1' then do; VAR63 = '99'; VAR64 = '99'; VAR65 = '9999'; end; if VAR63 = ' ' then VAR63 = '99'; if VAR64 = ' ' then VAR64 = '99'; if VAR65 = ' ' then VAR65 = '9999'; label VAR66 = 'Type of first cancer-directed surgery'; /* Added for 2018 tumors, new field in V18 */ yyyymm_def = substr(rxDateMostDefinSurg,1,6) ; yyyymm_sur = substr(rxDateSurgery,1,6) ; if indexsite = 'Breast' and yyyymm_def = yyyymm_sur then do ; if rxSummSurgPrimSite in ('20','21','22','23','24') then VAR66 = '1' ; else if rxSummSurgPrimSite GE '30' AND rxSummSurgPrimSite LE '80' then VAR66 = '2' ; else if rxSummSurgPrimSite in ('00','19','99') then VAR66 = '7' ; else if rxSummSurgPrimSite = '90' then VAR66 = '9' ; end ; if indexsite = 'Cervix' and yyyymm_def = yyyymm_sur then do ; if rxSummSurgPrimSite in ('30','40','60','61','62') then VAR66 = '3' ; else if rxSummSurgPrimSite in ('50','51','52','53','54', '70','71','72','73','74') then VAR66 = '4' ; else if rxSummSurgPrimSite in ('00','10','11','12','13','14','15','16','17', '20','21','22','23','24','25','26','27','28','29','99') then VAR66 = '7' ; else if rxSummSurgPrimSite = '90' then VAR66 = '9' ; end ; if indexsite = 'Ovary' then VAR66 = '9' ; /* Unable to code NAACCR fields to VAR66 for Ovary */ if VAR66 = '' then VAR66 = '9' ; label VAR67 = 'Place of first cancer-directed surgery'; VAR67 = '9'; label VAR68 = 'Lymphadenectomy'; /* Added to VENUSCANCER SAS code in 2022, not new fields */ if indexsite in ('Breast','Cervix') then do ; if regionalNodesPositive = '98' then VAR68 = '2' ; else if regionalNodesPositive LE '97' then VAR68 = '1' ; else if VAR68 = '' then VAR68 = '9' ; end ; if indexsite in ('Ovary') then VAR68 = '9'; label VAR69 = 'Day of Lymphadenectomy'; /* Added to VENUSCANCER SAS code in 2022, not new fields */ if indexsite in ('Breast','Cervix') then do ; VAR69 = substr(dateRegionalLNDissection,7,2) ; end ; if VAR69 = '' then VAR69 = '99'; label VAR70 = 'Month of Lymphadenectomy'; /* Added to VENUSCANCER SAS code in 2022, not new fields */ if indexsite in ('Breast','Cervix') then do ; VAR70 = substr(dateRegionalLNDissection,5,2) ; end ; if VAR70 = '' then VAR70 = '99'; label VAR71 = 'Year of Lymphadenectomy'; /* Added to VENUSCANCER SAS code in 2022, not new fields */ if indexsite in ('Breast','Cervix') then do ; VAR71 = substr(dateRegionalLNDissection,1,4) ; end ; if VAR71 = '' then VAR71 = '9999'; label VAR72 = 'Radiotherapy'; if VAR13 < '2018' then do ; if rxSummRadiation in ('0','7') then VAR72 = '2'; else if ('1' le rxSummRadiation and rxSummRadiation le '5') then VAR72 = '1'; else VAR72 = '9'; end ; if VAR13 = '2018' then do ; /* Added for 2018 tumors, new field in V18 */ if ( phase1RadiationTreatmentModality in ('01','02','03','04','05','06','07','08','09','10','98') OR phase2RadiationTreatmentModality in ('01','02','03','04','05','06','07','08','09','10','98') OR phase3RadiationTreatmentModality in ('01','02','03','04','05','06','07','08','09','10','98') ) then VAR72 = '1' ; else if (phase1RadiationTreatmentModality = '00' AND phase2RadiationTreatmentModality = '00' AND phase3RadiationTreatmentModality = '00') then VAR72 = '2' ; else if (phase1RadiationTreatmentModality in ('99','88') AND phase2RadiationTreatmentModality in ('99','88') AND phase3RadiationTreatmentModality in ('99','88')) then VAR72 = '9' ; end ; if VAR72 = '' then VAR72 = '9' ; label VAR73 = 'Day of radiotherapy'; label VAR74 = 'Month of radiotherapy'; label VAR75 = 'Year of radiotherapy'; VAR73 = substr(rxDateRadiation,7,2); VAR74 = substr(rxDateRadiation,5,2); VAR75 = substr(rxDateRadiation,1,4); if VAR72 ne '1' then do; VAR73 = '99'; VAR74 = '99'; VAR75 = '9999'; end; if VAR73 = ' ' then VAR73 = '99'; if VAR74 = ' ' then VAR74 = '99'; if VAR75 = ' ' then VAR75 = '9999'; label VAR76 = 'Total radiotherapy dose (Gy)'; /* Added for 2018 tumors, new field in V18 */ if indexsite NE ('Ovary') then do ; if (phase1TotalDose GE '000001' AND phase1TotalDose LE '999997') then p1 = (phase1TotalDose+0)/1000 ; if (phase2TotalDose GE '000001' AND phase2TotalDose LE '999997') then p2 = (phase2TotalDose+0)/1000 ; if (phase3TotalDose GE '000001' AND phase3TotalDose LE '999997') then p3 = (phase3TotalDose+0)/1000 ; VAR76 = put(round(sum(p1,p2,p3)),z2.) ; end ; if VAR76 in ('',' .') then VAR76 = '99' ; label VAR77 = 'No. of radiotherapy fractions'; /* Added for 2018 tumors, new field in V18 */ if indexsite NE ('Ovary') then do ; if (phase1NumberOfFractions GE '001' AND phase1NumberOfFractions LE '998') then f1 = (phase1NumberOfFractions+0) ; if (phase2NumberOfFractions GE '001' AND phase2NumberOfFractions LE '998') then f2 = (phase2NumberOfFractions+0) ; if (phase3NumberOfFractions GE '001' AND phase3NumberOfFractions LE '998') then f3 = (phase3NumberOfFractions+0) ; VAR77a = put(round(sum(f1,f2,f3)),z3.) ; end ; if VAR77a GT '090' then VAR77a = '999' ; if VAR77a in ('',' .') then VAR77a = '999' ; VAR77 = substr(VAR77a,2,2) ; drop VAR77a f1 f2 f3 p1 p2 p3 ; label VAR78 = 'Chemotherapy'; if rxSummChemo in ('01','02','03') then VAR78 = '1'; else if rxSummChemo in ('00','82','85','86','87') then VAR78 = '2'; else VAR78 = '9'; label VAR79 = 'Day of chemotherapy'; label VAR80 = 'Month of chemotherapy'; label VAR81 = 'Year of chemotherapy'; VAR79 = substr(rxDateChemo,7,2); VAR80 = substr(rxDateChemo,5,2); VAR81 = substr(rxDateChemo,1,4); if VAR78 ne '1' then do; VAR79 = '99'; VAR80 = '99'; VAR81 = '9999'; end; if VAR79 = ' ' then VAR79 = '99'; if VAR80 = ' ' then VAR80 = '99'; if VAR81 = ' ' then VAR81 = '9999'; label VAR82 = 'No. of chemotherapy cycles'; VAR82 = '99'; label VAR83 = 'Endocrine Treatment'; if indexsite = 'Breast' then do; if rxSummHormone = '01' then VAR83 = '1'; else if rxSummHormone in ('00','82','85','86','87') then VAR83 ='2'; else VAR83 = '9'; end; else VAR83 = '9'; label VAR84 = 'Year of first endocrine treatment'; VAR84 = substr(rxDateHormone,1,4); if VAR83 ne '1' then VAR84 = '9999'; if VAR84 = ' ' then VAR84 = '9999'; label VAR85 = 'Anti-HER-2 monclonal antibody treatment'; VAR85 = '9'; label VAR86 = 'Day of Anti-HER-2 monoclonal antibody treatment'; VAR86 = '99'; label VAR87 = 'Month of Anti-HER-2 monoclonal antibody treatment'; VAR87 = '99'; label VAR88 = 'Year of Anti-HER-2 monoclonal antibody treatment'; VAR88 = '9999'; label VAR89 = 'Clinical Trial'; VAR89 = '9'; label VAR90 = 'Education'; VAR90 = '9'; label VAR91 = 'No. of persons living in the same household'; VAR91 = '9'; label VAR92 = 'Home ownership'; VAR92 = '9'; label VAR93 = 'Water supply'; VAR93 = '9'; label VAR94 = 'Electricity supply'; VAR94 = '9'; label VAR95 = 'Sanitation'; VAR95 = '9'; label VAR96 = 'Socio-economic group'; VAR96 = '9'; label VAR97 = 'Marital status'; if maritalStatusAtDx = '2' then VAR97 = '1'; else if maritalStatusAtDx in ('1','3','4','5','6') then VAR97 = '2'; else VAR97 = '9'; label VAR98 = 'Employment status'; VAR98 = '9'; label VAR99 = 'Health insurance status'; if primaryPayerAtDx in ('01','02') then VAR99 = '4'; else if primaryPayerAtDx = '10' then VAR99 = '3'; else if primaryPayerAtDx in ('20','21') then VAR99 = '1'; else if primaryPayerAtDx = '99' then VAR99 = '9'; else if primaryPayerAtDx in ('31','35') then VAR99 = '2'; else if '60' <= primaryPayerAtDx <= '68' then VAR99 = '2'; label VAR100 = 'Breast or ovarian cancer in female first-degree relatives'; VAR100 = '9'; label VAR101 = 'No. of affected relatives'; VAR101 = '9'; label VAR102 = 'Alcohol consumption'; VAR102 = '9'; label VAR103 = 'Smoking habit'; VAR103 = '9'; label VAR104 = 'Height (cm)'; /* Added to VENUSCANCER SAS code in 2022, not new fields */ VAR104 = '999' ; /* IF YOUR REGISTRY COLLECTS HEIGHT, AND IT IS AVAILABLE IN YOUR XML FILE, E.G. AS PART OF AN EXT-01 */ *if height = '' then height = '99' ; /* USE THIS CODE */ *if height NE '99' then VAR104 = put(((height+0)*2.54),z3.) ; *else VAR104 = '999'; label VAR105 = 'Weight (kg)'; /* Added to VENUSCANCER SAS code in 2022, not new fields */ VAR105 = '999' ; *if weight = '' then weight = '999' ; /* IF YOUR REGISTRY COLLECTS WEIGHT, AND IT IS AVAILABLE IN YOUR XML FILE, E.G. AS PART OF AN EXT-01 */ *if weight NE '999' then VAR105 = put(((weight+0)/2.2),z3.) ; /* USE THIS CODE */ *else VAR105 = '999'; label VAR106 = 'Cardiovascular conditions'; VAR106 = '9999'; label VAR107 = 'Diabetes'; VAR107 = '9999'; label VAR108 = 'Previous Cancer'; VAR108 = '9999'; label VAR109 = 'Renal impairment'; VAR109 = '9999'; label VAR110 = 'Liver impairement'; VAR110 = '9999'; label VAR111 = 'History of HIV'; VAR111 = '9'; run ; *** STEP 6 - CHECK RESULTS OF DATA TRANSLATION ***; title2 'CHECKS ON MAPPING FROM NAACCR ITEMS TO VENUSCANCER VARIABLES'; title3 'THERE SHOULD BE NO BLANK VALUES FOR ANY OF THE VENUSCANCER VARIABLES'; title4 &RegName; proc format; value $person ' ' = 'Missing' '00000001' - '99999998' = 'Present' '99999999' = 'Missing'; value $hist '9590' - '9992' = 'Haematological' '8720' - '8790' = 'Melanoma' '8000' - '8719' = 'Other' '8791' - '9589' = 'Other'; run; proc freq data=VENUSCANCER; format VAR3 $person.; tables VAR1 VAR2; tables VAR3; tables tumorRecordNumber * sequenceNumberCentral * VAR4 / list missing; tables sex VAR5; tables addrAtDxState countyAtDxGeocode2010 VAR6; run; proc freq data=VENUSCANCER; tables race1 race2 ihsLink nhiaDerivedHispOrigin VAR7; tables (race1 race2 ihsLink) * seerracerec / list missing nocol norow nopercent; tables seerracerec * nhiaDerivedHispOrigin * VAR7 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables VAR8 VAR9 VAR10; tables VAR11 VAR12 VAR13; tables vitalStatus * VAR14 / missing nocol norow nopercent; tables (VAR15 VAR16 VAR17) * VAR14 / missing nocol norow nopercent; run; proc print data=VENUSCANCER noobs n; where VAR14 = '9'; run; proc freq data=VENUSCANCER; where VAR14 = '3'; tables dateOfLastContact; title'Date last Contact for lost to followup patients'; run; proc print data=VENUSCANCER noobs n label; where VAR16 > '12'; title'Unknown Month of Last contact'; run; title1; proc freq data=VENUSCANCER; tables (diagnosticConfirmation typeOfReportingSource) * VAR18 / missing nocol norow nopercent; title; run; proc freq data=VENUSCANCER; tables indexsite * VAR19 / list missing nocol norow nopercent; tables histologicTypeIcdO3 * VAR20 /list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables (indexsite ) * VAR21 / missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables (indexsite ) * (VAR22 VAR25) / missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables ajccTnmClinTSuffix * VAR24 / missing nocol norow nopercent; run ; proc freq data=VENUSCANCER; tables tnmPathT * VAR27 / list missing nocol norow nopercent; tables ajccTnmPathT * VAR27 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables tnmPathN * VAR28 / list missing nocol norow nopercent; tables ajccTnmPathN * VAR28 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables tnmPathM * VAR29 / list missing nocol norow nopercent; tables ajccTnmPathM * VAR29 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables tnmClinT * VAR30 / list missing nocol norow nopercent; tables ajccTnmClinT * VAR30 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables tnmClinN * VAR31 / list missing nocol norow nopercent; tables ajccTnmClinN * VAR31 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables tnmClinM * VAR32 / list missing nocol norow nopercent; tables ajccTnmClinM * VAR32 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; where VAR13 = '2015'; tables indexsite*csMetsAtDxBrain*csMetsAtDxLiver*csMetsAtDxLung*csMetsAtDxBone*VAR33/ list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; where VAR13 > '2015'; tables indexsite*metsAtDxBrain*metsAtDxLiver*metsAtDxLung*metsAtDxBone*metsAtDxDistantLn*VAR33/ list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables indexsite * VAR33/ missing nocol norow nopercent; run; proc freq data=VENUSCANCER; where VAR13 < '2018'; tables indexsite * VAR34/ missing nocol norow nopercent; tables VAR18 * derivedSs2000 * seerSummaryStage2000 * VAR34 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; where VAR13 = '2018'; tables indexsite * VAR34/ missing nocol norow nopercent; tables VAR18 * derivedSummaryStage2018 * SummaryStage2018 * VAR34 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables indexsite * VAR38 / missing nocol norow nopercent; tables figoStage * VAR38 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables dateSentinelLymphNodeBiopsy * VAR40 / list missing nocol norow nopercent; tables rxSummScopeRegLnSur * VAR40 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables regionalNodesExamined * VAR41 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables regionalNodesPositive * VAR42 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables indexsite * VAR54 / missing nocol norow nopercent; tables indexsite* csSiteSpecificFactor1 * VAR54 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables indexsite * VAR55 / missing nocol norow nopercent; tables indexsite* csSiteSpecificFactor2 * VAR55 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables indexsite * VAR56 / missing nocol norow nopercent; tables indexsite* csSiteSpecificFactor9 * VAR56 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables indexsite * VAR57 / missing nocol norow nopercent; tables indexsite* csSiteSpecificFactor11 * VAR57 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables indexsite * VAR58 / missing nocol norow nopercent; tables indexsite* ki67 * VAR58 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; tables indexsite * VAR59 / missing nocol norow nopercent; tables indexsite* ca125PretreatmentInterpretation * VAR59 / list missing nocol norow nopercent; run; *** TREATMENT-RELATED QC BEGINS HERE ***; proc freq data=VENUSCANCER; title 'Initial Course of Treatment'; tables var62-var89; run; proc freq data=VENUSCANCER; tables rxSummSurgPrimSite * VAR62 * VAR65 / list missing nocol norow nopercent; tables rxSummSurgPrimSite * VAR66 / list missing nocol norow nopercent; tables rxSummRadiation * VAR72 * VAR75 / list missing nocol norow nopercent; tables regionalNodesPositive * VAR68 / list missing nocol norow nopercent; tables VAR69 / list missing nocol norow nopercent; tables VAR70 / list missing nocol norow nopercent; format dateRegionalLNDissection $4. ; tables dateRegionalLNDissection * VAR71 / list missing nocol norow nopercent; tables phase1RadiationTreatmentModality * VAR72 ; tables phase1TotalDose * VAR76 / list missing nocol norow nopercent; tables phase1NumberOfFractions * VAR77 / list missing nocol norow nopercent; tables rxSummChemo * VAR78 * VAR81 / list missing nocol norow nopercent; tables rxSummHormone * VAR83 * VAR84 / list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; title'Socio-economic Status'; tables VAR90-VAR97 / missing nocol norow nopercent; tables maritalStatusAtDx * VAR97/list missing nocol norow nopercent; tables VAR98 / missing nocol norow nopercent; tables primaryPayerAtDx*VAR99 VAR99/list missing nocol norow nopercent; run; proc freq data=VENUSCANCER; title'Family History'; tables VAR100 VAR101 / missing nocol norow nopercent; run; proc freq data=VENUSCANCER; title'Lifestyle'; tables VAR102-VAR105 / missing nocol norow nopercent; run; proc freq data=VENUSCANCER; title'Concurrent medical conditions'; tables VAR106-VAR111 / missing nocol norow nopercent; run; *** STEP 8 - WRITE THE 3 DATA FILES FOR EACH REGISTRY TO SUBMIT TO VENUSCANCER ***; proc sort data=VENUSCANCER; by VAR3 VAR4; run; %let C3Version = V; %let C3SiteCode = 09; %let fname = '&OutLib&C3Version&VAR1&VAR2&C3SiteCode&C3SUB'; %let fstar = %unquote(%str(filename Breast %bquote(&fname) lrecl=700)); &fstar; %let C3SiteCode = 10; %let fname = '&OutLib&C3Version&VAR1&VAR2&C3SiteCode&C3SUB'; %let fstar = %unquote(%str(filename Cervix %bquote(&fname) lrecl=700)); &fstar; %let C3SiteCode = 11; %let fname = '&OutLib&C3Version&VAR1&VAR2&C3SiteCode&C3SUB'; %let fstar = %unquote(%str(filename Ovary %bquote(&fname) lrecl=700)); &fstar; /* data breast cervix ovary; set venuscancer; if '015' <= ageAtDiagnosis <= '099'; keep var1-var111; if indexsite = 'Breast' then output breast; else if indexsite = 'Cervix' then output cervix; else if indexsite = 'Ovary' then output ovary; proc export data=breast dbms=csv file=fname replace; proc export data=cervix dbms=csv file=fname replace; run; endsas; */ data _null_; file Breast; put 'VAR1,VAR2,VAR3,VAR4,VAR5,VAR6,VAR7,VAR8,VAR9,VAR10,VAR11,VAR12,VAR13,VAR14,VAR15,VAR16,VAR17,VAR18,VAR19,VAR20,VAR21,VAR22,VAR23,VAR24,VAR25,VAR26,VAR27,VAR28,VAR29,VAR30,VAR31,VAR32,VAR33,VAR34,VAR35,VAR36,VAR37,VAR38,VAR39,VAR40,VAR41,VAR42,VAR43,VAR44,VAR45,VAR46,VAR47,VAR48,VAR49,VAR50,VAR51,VAR52,VAR53,VAR54,VAR55,VAR56,VAR57,VAR58,VAR59,VAR60,VAR61,VAR62,VAR63,VAR64,VAR65,VAR66,VAR67,VAR68,VAR69,VAR70,VAR71,VAR72,VAR73,VAR74,VAR75,VAR76,VAR77,VAR78,VAR79,VAR80,VAR81,VAR82,VAR83,VAR84,VAR85,VAR86,VAR87,VAR88,VAR89,VAR90,VAR91,VAR92,VAR93,VAR94,VAR95,VAR96,VAR97,VAR98,VAR99,VAR100,VAR101,VAR102,VAR103,VAR104,VAR105,VAR106,VAR107,VAR108,VAR109,VAR110,VAR111'; file Cervix; put 'VAR1,VAR2,VAR3,VAR4,VAR5,VAR6,VAR7,VAR8,VAR9,VAR10,VAR11,VAR12,VAR13,VAR14,VAR15,VAR16,VAR17,VAR18,VAR19,VAR20,VAR21,VAR22,VAR23,VAR24,VAR25,VAR26,VAR27,VAR28,VAR29,VAR30,VAR31,VAR32,VAR33,VAR34,VAR35,VAR36,VAR37,VAR38,VAR39,VAR40,VAR41,VAR42,VAR43,VAR44,VAR45,VAR46,VAR47,VAR48,VAR49,VAR50,VAR51,VAR52,VAR53,VAR54,VAR55,VAR56,VAR57,VAR58,VAR59,VAR60,VAR61,VAR62,VAR63,VAR64,VAR65,VAR66,VAR67,VAR68,VAR69,VAR70,VAR71,VAR72,VAR73,VAR74,VAR75,VAR76,VAR77,VAR78,VAR79,VAR80,VAR81,VAR82,VAR83,VAR84,VAR85,VAR86,VAR87,VAR88,VAR89,VAR90,VAR91,VAR92,VAR93,VAR94,VAR95,VAR96,VAR97,VAR98,VAR99,VAR100,VAR101,VAR102,VAR103,VAR104,VAR105,VAR106,VAR107,VAR108,VAR109,VAR110,VAR111'; file Ovary; put 'VAR1,VAR2,VAR3,VAR4,VAR5,VAR6,VAR7,VAR8,VAR9,VAR10,VAR11,VAR12,VAR13,VAR14,VAR15,VAR16,VAR17,VAR18,VAR19,VAR20,VAR21,VAR22,VAR23,VAR24,VAR25,VAR26,VAR27,VAR28,VAR29,VAR30,VAR31,VAR32,VAR33,VAR34,VAR35,VAR36,VAR37,VAR38,VAR39,VAR40,VAR41,VAR42,VAR43,VAR44,VAR45,VAR46,VAR47,VAR48,VAR49,VAR50,VAR51,VAR52,VAR53,VAR54,VAR55,VAR56,VAR57,VAR58,VAR59,VAR60,VAR61,VAR62,VAR63,VAR64,VAR65,VAR66,VAR67,VAR68,VAR69,VAR70,VAR71,VAR72,VAR73,VAR74,VAR75,VAR76,VAR77,VAR78,VAR79,VAR80,VAR81,VAR82,VAR83,VAR84,VAR85,VAR86,VAR87,VAR88,VAR89,VAR90,VAR91,VAR92,VAR93,VAR94,VAR95,VAR96,VAR97,VAR98,VAR99,VAR100,VAR101,VAR102,VAR103,VAR104,VAR105,VAR106,VAR107,VAR108,VAR109,VAR110,VAR111'; run; data _null_; set VENUSCANCER; if indexsite = 'Breast' and ageAtDiagnosis >= '015' and ageAtDiagnosis <= '099' then do; file Breast mod dlm=','; put VAR1-VAR111; end; else if indexsite = 'Cervix' and ageAtDiagnosis >= '015' and ageAtDiagnosis <= '099' then do; file Cervix mod dlm=','; put VAR1-VAR111; end; else if indexsite = 'Ovary' and ageAtDiagnosis >= '015' and ageAtDiagnosis <= '099' then do; file Ovary mod dlm=','; put VAR1-VAR111; end; run;