This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The seven building blocks of a good prompt are: | |
Role | |
Task | |
Goal | |
Audience | |
Tone | |
Format | |
Sample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"I want you to become my Prompt Creator. Your goal is to help me craft the best possible prompt for my needs. The prompt will be used by you, GPT. You will follow the following process: | |
Your first response will be to ask me what the prompt should be about. I will provide my answer, but we will need to improve it through continual iterations by going through the next steps. | |
Based on my input, you will generate three sections: a) Revised prompt: Provide your rewritten prompt. It should be clear, concise, and easily understood by you. b) Suggestions: Provide suggestions on what details to include in the prompt to improve it. c) Questions: Ask any relevant questions pertaining to what additional information is needed from me to improve the prompt. | |
We will continue this iterative process with me providing additional information to you and you updating the prompt in the Revised prompt section until it's complete." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This program downloads some data from Statistics Canada and saves it in a databricks catalog | |
#F. Khurshed | |
#2024-07-16 | |
#installl and load relevant packages | |
install.packages("cansim") | |
install.packages("sparklyr") | |
library(cansim) | |
library(sparklyr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*------------------------------------------------------------------* | |
| MACRO NAME : tablen | |
| SHORT DESC : Creates a descriptives table of multiple variables | |
*------------------------------------------------------------------* | |
| CREATED BY : Meyers, Jeffrey (07/28/2016 3:00) | |
*------------------------------------------------------------------* | |
| VERSION UPDATES: | |
| 2.46 11/03/2021 | |
| Changed code to avoid truncating character strings at 200 | |
| 2.45 08/25/2021 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*path to the zip file; | |
filename src zip "/home/fkhurshed/Demo2/P_DR2IFF.zip"; | |
*path to where to save the xpt file; | |
filename xl "/home/fkhurshed/Demo2/P_DR2IFF.xpt" ; | |
*extract file from zip - P_DR2IFF.XPT in the code below is the name of the file in the zipped file that is to be extracted; | |
data _null_; | |
/* using member syntax here */ | |
infile src(P_DR2IFF.XPT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Author: F.Khurshed | |
Date: 2022-10-07*/ | |
*create library to store format catalog; | |
libname demo '/home/fkhurshed/Demo1'; | |
proc format; | |
value age_fmt | |
low - 12 = 'Child' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*This program illustrates how to loop through by calendar months and calculate a moving statistic*/ | |
data have; | |
set sashelp.stocks; | |
run; | |
*sort for faster processing and add index; | |
proc sort data=have out=have (index=(date)); | |
by date; | |
run; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*This macro will export a file to a data set and split it based on the number of records per sheet; | |
%macro export_split (dsn=, size=); | |
%*Get number of records and calculate the number of files needed; | |
data _null_; | |
set &dsn. nobs=_nobs; | |
call symputx('nrecs', _nobs); | |
n_files=ceil(_nobs/ &size.); | |
call symputx('nfiles', n_files); | |
stop; | |
run; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*This is an example of how to create an Other category for everything except the top 3*/ | |
*not ideal, other becomes first format - will look into how to make it last value; | |
*get counts; | |
proc freq data=sashelp.class order = freq; | |
table age / out=counts; | |
run; | |
*create format; | |
data counts_fmt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*This example demonstrates how you can merge data with a formatted variable and not have to create a new variable; | |
data stocks_A; | |
set sashelp.stocks; | |
where stock='IBM'; | |
format date yymmn6.; | |
*keep only relevant variables for testing; | |
keep date open; | |
*rename to identify source; |
NewerOlder