Check out a few of my favorite things about SAS Viya Workbench!
Recent Library Articles
Recently in the SAS Support Community: SAS' @PeterChristie opines on SAS Viya Workbench, a cloud-based application for Python and SAS developers and data scientists. Accessed through a browser, it allows you to run SAS 9 code and SAS Viya analytics within the same environment without having to install either SAS 9 or SAS Viya.
[AI-generated Proc Studley]Here's the situation: The adventures of Proc Studley -- a popular Sci-Fi/Fantasy book series -- is under threat by a string of counterfeit/fake versions that have hit the marketplace. Your task is to find the fakes. All of the authentic books have valid ISBN 10-digit numbers, which is how world libraries track books. The counterfeit books have invalid ISBN values.
(This challenge first premiered in SAS Analytics Explorers, a special group for customers who want to do more with their SAS learning and earn rewards in the process!)
The algorithm for validating ISBN-10 values uses a checksum approach. Here are the steps:
Multiply each of the first 9 digits by a number in the descending sequence from 10 to 2, and sum the results.
Divide the sum by 11.
Subtract the remainder (not the quotient) from 11.
For the 10th digit, use the difference from the previous step. If that difference is 11, use the number 0; if 10, use the letter X.
Here are the book titles and their purported ISBN values. Write a the shortest possible SAS program that reads the book list, validates each ISBN value, and create a report of the real and fake books. Include your code and the output in your response!
(Note: obviously all of these books are made up, but the ISBN number scheme and algorithm is a real thing! You can check your work ad hoc with the ISBN Checker.)
Here's the data, all ready to run in SAS.
data isbn;
infile datalines dsd;
length title $ 70 isbn $ 10;
input title isbn;
datalines;
Proc Studley and the Starship of Destiny,0434488665
The Chronicles of Proc Studley: The Lost Realm,2018166516
Proc Studley and the Quantum Key,9405643837
The Legend of Proc Studley: The Celestial Quest,6032522768
Proc Studley and the Enchanted Nebula,4394205952
The Adventures of Proc Studley: The Galactic Rift,2353276079
Proc Studley and the Time Crystal,6493135591
The Saga of Proc Studley: The Forbidden Planet,6776994355
Proc Studley and the Alien Alliance,2227835451
The Epic of Proc Studley: The Cosmic War,8018735913
Proc Studley and the Dragon of Andromeda,0841779538
The Odyssey of Proc Studley: The Stellar Siege,8730652341
Proc Studley and the Phoenix Star,1594122350
The Journey of Proc Studley: The Nebula Nexus,224320418X
Proc Studley and the Shadow Realm,6857923406
The Quest of Proc Studley: The Celestial Citadel,3967006111
Proc Studley and the Interstellar Insurrection,9537581977
The Trials of Proc Studley: The Quantum Paradox,1283514257
Proc Studley and the Martian Rebellion,566485052X
The Legacy of Proc Studley: The Galactic Guardians,6994588902
Proc Studley and the Eternal Eclipse,9236137644
The Chronicles of Proc Studley: The Andromeda Enigma,7649918275
Proc Studley and the Infinite Horizon,458574645X
The Adventures of Proc Studley: The Alien Dawn,7601111520
Proc Studley and the Black Hole Conspiracy,1911465988
The Legend of Proc Studley: The Cosmic Code,266671036X
Proc Studley and the Celestial Shadows,4287030303
The Saga of Proc Studley: The Stellar Saga,2561407012
Proc Studley and the Quantum Quest,6933010252
The Epic of Proc Studley: The Celestial Conflict,4278675463
Proc Studley and the Galactic Gambit,351049735X
The Odyssey of Proc Studley: The Nebula Knights,0566910450
Proc Studley and the Cosmic Crusade,9802436077
The Journey of Proc Studley: The Andromeda Ascension,195432331X
Proc Studley and the Stellar Struggle,8421179217
The Quest of Proc Studley: The Alien Artifact,0979272564
Proc Studley and the Celestial Saga,3584795834
The Trials of Proc Studley: The Galactic Genesis,0713565068
Proc Studley and the Quantum Conundrum,9074601407
The Legacy of Proc Studley: The Cosmic Odyssey,0168786583
;
run;
... View more
I was following the below code to create Deployment Directories before I migrate metadata from old to new but getting error from SASEG , it sasy App Context not found, attached the complete logfile from SASEG, can you review and suggest if I need to make any changes in the configuration t?. ERROR: A single context named SASGrid not found. Please note We have renamed SASApp to SASGrid while deploying technical-support-code/usage/administration/sas-metadata-server/create_metadata_deployment_directories_s9.sas at main · sascommunities/technical-support-code · GitHub
... View more
I need to count number of patients with continuous enrollment after indexdt by month in claims data in SAS. Below is my data structure. startdt is the starting date of insurance coverage and enddt is the end date of insurance coverage. If there a gap between two start dates, the patient is categorized no continuous enrollment (continuous_enroll=0), otherwise has continuous enrollment (continuous_enroll=1). data input; input ID $1. startdt:mmddyy10. enddt:mmddyy10. indexdt :mmddyy10. continuous_enroll; format startdt date9. enddt date9. indexdt date9. ; datalines; 1 1/1/2020 1/31/2020 3/12/2020 . 1 2/1/2020 2/28/2020 3/12/2020 1 1 3/1/2020 3/31/2020 3/12/2020 1 1 5/1/2020 5/31/2020 3/12/2020 0 2 8/1/2019 8/31/2019 3/16/2020 . 2 3/1/2020 3/31/2020 3/16/2020 0 3 4/1/2020 4/30/2020 4/13/2020 . 3 5/1/2020 5/31/2020 4/13/2020 1 3 8/1/2020 8/31/2020 4/13/2020 0 3 9/1/2020 9/31/2020 4/13/2020 1 ; run; I need to count the number of unique patients with continuous enrollment 1 month after index date. the number of unique patients with continuous enrollment 2 month after index date. the number of unique patients with continuous enrollment 3 month after index date. .... All the way up to 12 months. Let me know if my question is not clear. Thank you for your help!
... View more
Hey all! TL;DR: In viya4, I am trying to work with aggregated measures inside condition but it failed, how can it be solved? my mission is to convert SAS code into VA steps, such that no code will be needed. I am trying to replace proc ranks (which calculates percentiles and creates a new column 'p') with 'percentile' function, applying it twice (I am interested in percentile10 & 90). then, I am trying to check "if column < percentile10 then 1 else 0", which can later be used just as 'p' column has been used. I got an error as attached here. any ideas? Thanks!
... View more
Dear all: I used restricted cubic spline (RCS) to plot the mortality hazard ratio of body mass index. The hazard ratio was adjusted by age, viral type, SOFA score, and bicarbionate. However, there were two results of P-value for nonlinearity (Counts1 = 0.2264 and Counts2 = 0.6636). Which one should i use? I used BMI=18.5 as the single knot. The following figure was the RCS plot.
... View more