Welcome to a clinical data management program using SAS In this video we will be discussing about the topic that is formatting data that is how to format our data. In fact there are two types of formats for the SAS format system different formats and others use a different formats. First will lead with SAS formats and then we will be dealing with user defined forms. The general structure of a SAS format is first you have to read the format name and the format meaning can start with $1 sign if it is a character format and will not start with $1 sign either numeric. Next is the width there is a maximum length. Next is dot that is the delimiter And next is number of decimal places after the decimal point down at start, we only use the procedure that disrupted that is we'll be displaying the format's in our report or our results that we will be formatting of the verse and the formats will be incorporated in our variables and those will be displayed in our reports that is our variables will be displayed in the session.
Pay for method we specify in the result view or the report that you generate. So we use the same procedure that is copying data equals CDA dot disease is the same dataset that we were working with that we have imported from the library that is very important Excel file and we had brought it in to our library CDM it created that I've used in the opening statement. As you know that for covenant library, we have to specify the library name but if it was located at work, it is not compulsory to specify the library properly that would signal disease and then we want to format our variable that is God It stands for Date of Birth by date night. So there are a number of formats. They promised us as GDP by a.vi given a ten.mm dd a dot date nine dot format Paid seven.com. And we did format, what date format.
There are a number of formats here we are going to format our date of God, we will by date named or formats. So we'll do format, DOB, date name dot, then we'll give a semicolon. And then to see the Dewey variables discrete data in a distributed manner, you first have the date, the month and then the year, this is the date and not 800 because maximum length is 912-345-6789. You want to do in some other format see what data tells you to do just read voted up. I'm just showing another example of format. Another example of a format so this is the word leader format because you have the month that he did command in the EU.
This is the format of it. So this is my SAS format how to define the SAS format specifier SAS for now how to create a user defined formats what is user defined comments. See for example in your data you have got a variable called gender which consists of median female and you want to make the values inside a variable country sock like in this data that we're able to work with see the data has got a variable called gender which consists of Alice female male female, we want to we want to replace this female by F. And mean by this we have to do using a user defined for that we will do that now. So for that you use a procedure called proc format. First we'll be creating the format and that will be created inside SAS proc former to deliver genuity result viewer, the format that we created for format that format we are going to apply in our property procedure and then that format will be displayed in our report when we execute our property.
So first, we'll create a format using the proper Common Procedure that is comma semicolon, where you have to give a format name just because it's a character format army common names start with the dollar saying that any name of the format remember that when we create a user defined format, the format name should not be same as the format name of the SAS one. So dollar name of the format is sex, say any name can give her the value that is female, I want to replace female, but if all the textures so we have to give them within double quotes. I want to replace me I am then let's Yo what's up after the Ender fan statement this comment statement will not generate any result we were just the code will basically see the layout the format is created. The name of comment is dollar six be incorporating this format in our proper procedures in PROC PRINT data equals CDM doc disease semicolon, then we write format the name of a variable is gender.
First we read the variable name then dollar sex.this.is compulsory you have to give up these this very format name and then semicolon and then so let's run this code See here, the gender female got replaced by a and then he got replaced by M. So this is called the user defined POC. So in this video we'll be learning till here. In our next video, we will be discussing about sorting and removing duplicates that is how to sort our data, how to group our data and how to remove the duplicate values from our data. So for now, let me end this video over here. Thank you. Good bye.
See you on the next