02-25-2017
AG_Stats
Quartz | Level 8
Member since
02-24-2016
- 65 Posts
- 59 Likes Given
- 2 Solutions
- 2 Likes Received
-
Latest posts by AG_Stats
Subject Views Posted 1094 06-03-2016 08:33 AM 1950 06-02-2016 07:58 AM 1982 06-01-2016 03:59 AM 1278 06-01-2016 03:34 AM 48786 05-29-2016 12:09 PM 48794 05-29-2016 10:57 AM 49028 05-22-2016 02:37 AM 49039 05-21-2016 03:16 AM 49066 05-19-2016 06:43 AM 49076 05-19-2016 01:48 AM -
Activity Feed for AG_Stats
- Posted Proc Format to Data-set Containing Formats on SAS Programming. 06-03-2016 08:33 AM
- Posted Re: Can we name user-defined names to user-defined formats? on SAS Programming. 06-02-2016 07:58 AM
- Liked Re: Can we name user-defined names to user-defined formats? for ballardw. 06-02-2016 07:46 AM
- Liked Re: Can we name user-defined names to user-defined formats? for LinusH. 06-02-2016 07:45 AM
- Liked Re: Can we name user-defined names to user-defined formats? for Kurt_Bremser. 06-02-2016 07:45 AM
- Liked Re: Can we name user-defined names to user-defined formats? for RW9. 06-02-2016 07:45 AM
- Posted Can we name user-defined names to user-defined formats? on SAS Programming. 06-01-2016 03:59 AM
- Posted Re: How can we write text to an external text file and on output window while using data _null_ on SAS Programming. 06-01-2016 03:34 AM
- Liked Re: How can we write text to an external text file and on output window while using data _null_ for Tom. 05-30-2016 01:46 PM
- Posted Re: How can we write text to an external text file and on output window while using data _null_ on SAS Programming. 05-29-2016 12:09 PM
- Posted Re: How can we write text to an external text file and on output window while using data _null_ on SAS Programming. 05-29-2016 10:57 AM
- Liked Re: How can we write text to an external text file and on output window while using data _null_ for Tom. 05-29-2016 10:51 AM
- Liked Re: How can we write text to an external text file and on output window while using data _null_ for Tom. 05-29-2016 10:49 AM
- Posted Re: How can we write text to an external text file and on output window while using data _null_ on SAS Programming. 05-22-2016 02:37 AM
- Liked Re: How can we write text to an external text file and on output window while using data _null_ for Tom. 05-22-2016 02:22 AM
- Posted Re: How can we write text to an external text file and on output window while using data _null_ on SAS Programming. 05-21-2016 03:16 AM
- Liked Re: How can we write text to an external text file and on output window while using data _null_ for ballardw. 05-21-2016 02:54 AM
- Posted Re: How can we write text to an external text file and on output window while using data _null_ on SAS Programming. 05-19-2016 06:43 AM
- Liked Re: How can we write text to an external text file and on output window while using data _null_ for BrunoMueller. 05-19-2016 06:38 AM
- Posted Re: How can we write text to an external text file and on output window while using data _null_ on SAS Programming. 05-19-2016 01:48 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1 1 1 -
My Liked Posts
Subject Likes Posted 1 04-27-2016 12:13 PM 1 02-24-2016 01:23 PM
06-03-2016
08:33 AM
Hi, Below is a short program having some one-to-one and many-to-one formats. I want a dataset for the same and want to use that dataset as formats. Also I have attached a txt file containing all values and required labels (in which you can change, if required "low" to 0 and "high" to 100 for age formats): proc format library=myfmts;
value $gender 'M'='Male' 'F'='Female' ' '='Not entered' other='Miscoded';
value age low-29='Less than 30' 30-50='30 to 50' 51-high='51+';
value $likert '1'='Strongly disagree' '2'='Disagree' '3'='No opinion'
'4'='Agree' '5'='Strongly agree';
value $likert_new '1'-'3' = 'Agree' '4','5' = 'Disagree';
run; Please give me required sas codes.
... View more
06-02-2016
07:58 AM
Thanks RW9. However, I only know to make dataset for character formats (and somewhat for numeric). Can you give me an example of dataset (or raw text file) having formats for group of ranges. For this please give me the codes, use the following formats: proc format library=myfmts;
value $gender 'M'='Male' 'F'='Female' ' '='Not entered' other='Miscoded';
value age low-29='Less than 30' 30-50='30 to 50' 51-high='51+';
value $likert '1'='Strongly disagree' '2'='Disagree' '3'='No opinion'
'4'='Agree' '5'='Strongly agree';
value $likert_new '1'-'3' = 'Agree' '4','5' = 'Disagree';
run; Thanks in Advance,
... View more
06-01-2016
03:59 AM
Below is a program to create some user-defined formats and to store them in myfmts library: libname myfmts '/folders/myfolders/formats';
libname learn '/folders/myfolders';
proc format library=myfmts;
value $gender 'M'='Male' 'F'='Female' ' '='Not entered' other='Miscoded';
value age low-29='Less than 30' 30-50='30 to 50' 51-high='51+';
value $likert '1'='Strongly disagree' '2'='Disagree' '3'='No opinion'
'4'='Agree' '5'='Strongly agree';
run;
proc format library=myfmts;
value agenew low-<10 = 'Less Than 10' 10-<20 = '10-20' 20-<30 = '20-30'
30-<40 = '30-40' 40-<50 = '40-50' 50-high = 'Greater Than 50';
run; Now, all formats are getting stored in same file viz. "formats.sas7bcat". Can I, 1. Change the name of this file to say, age_fmts etc. while programming. 2. Here, I am using proc format procedure two times, generally I want to save two (format) files in my library myfmts (or to my folder "formats"). But, I am getting only one file viz. formats.sas7bcat instead of two. However, I can see that all of my formats are get saved in same file (formats.sas7bcat) by running: proc format library=myfmts fmtlib; run; commands. But, can I generate two files in same folder "formats" and can I decide there names also.
... View more
06-01-2016
03:34 AM
Thanks, your codes are working well & meet my purpose.
... View more
05-29-2016
12:09 PM
I mean can I get output like this: Name Gender Age Weight *<----- Can I get variable name as well (in output file); abc M 68 72 xyz F 62 68
... View more
05-29-2016
10:57 AM
Sorry for late reply from my side, but can you reply to second question / point of my last message viz. 2. Besides this can we print variable names as well? (while we are printing files (text or csv) by using data _null_)
... View more
05-22-2016
02:37 AM
I meant that only I am able to add tabs ( '07'x etc.) or spaces (" ") between two observations but I am not able to get each new observation in new line. 1. Is there any way to get new observation in new line while writing a text file (using file and put statements)? or can we use new line character line '\n' in C Programs? 2. Besides this can we print variable names as well? Note: However, for csv files I am able to get one observation per line by using: file "/folders/myfolders/someFile2.csv" dsd;
... View more
05-21-2016
03:16 AM
Hi Ballardw, Below are the codes: data _null_; set sashelp.class; file "/folders/myfolders/someFile.txt"; put name age sex; file print; put name age sex; run; Here is the LOG: 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 55 56 data _null_; 57 set sashelp.class; 58 file "/folders/myfolders/someFile.txt"; 59 put name age sex; 60 file print; 61 put name age sex;run; NOTE: The file "/folders/myfolders/someFile.txt" is: Filename=/folders/myfolders/someFile.txt, Owner Name=root,Group Name=vboxsf, Access Permission=-rwxrwx---, Last Modified=21May2016:12:23:17 NOTE: 19 lines were written to file PRINT. NOTE: 19 records were written to the file "/folders/myfolders/someFile.txt". The minimum record length was 9. The maximum record length was 12. NOTE: There were 19 observations read from the data set SASHELP.CLASS. NOTE: DATA statement used (Total process time): real time 0.17 seconds cpu time 0.04 seconds 62 63 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 75 ****************************************; However, I am only able to add spaces/tabs by using the following codes: data _null_; set sashelp.class; file "/folders/myfolders/someFile1.txt"; put name age sex " "; *<--- Tab is added; file print; put name age sex; run; Notes: Both times by using file print I am getteing result in required format i.e. one observation per record/line. Below are the files generated by these two codes for your reference.. Thanks.
... View more
05-19-2016
06:43 AM
So Can't I do anything to get output in required format i.e. every new observation on new line. My OS is Windows 10.
... View more
05-19-2016
01:48 AM
Thanks Bruno, Can you tell me to how to get output in external file in format like this (instead of getting all values in single line): Alfred 14 M
Alice 13 F
Barbara 13 F
Carol 14 F
Henry 14 M
James 12 M
Jane 12 F
Janet 15 F
Jeffrey 13 M
John 12 M
Joyce 11 F
Judy 14 F
Louise 12 F
Mary 15 F
Philip 16 M
Robert 12 M
Ronald 15 M
Thomas 11 M
William 15 M
... View more
05-18-2016
12:21 PM
Hi Everyone, How can we write text to an external text file and on output window while using data _null_. Please explain with example.
... View more
05-18-2016
12:34 AM
What about PGStats I don't get. Does he saying truth or just making fun.. or has he temporarily blocked or what new thing has happened.
... View more
05-17-2016
02:48 PM
Hi Everyone, Please someone let me know that how many replies, messages or new topics do we have to start "Have Your Say"?
... View more
05-16-2016
07:59 AM
Quite useful, Thanks!
... View more
05-13-2016
07:17 AM
Hi, Please find an image below which might help you: The codes that I have given in my first post (question) are working well. Now, again consider my question as I explained below (forgot my previous datalines given below codes - where I have mestioned greater than 200 etc.): Only I want to add some more categories:- Start = ' '; End= Start; Hlo = 'o'; /* Or you can change it if required & can add type= I or C also */ Label = 'Not Found'; Start = ' '; End= Start; Hlo = 'H'; /* Or you can change it if required & can add type= I or C also */ Label = 'Greater_220'; Start = ' '; End= Start; Hlo = 'L'; /* Or you can change it if required & can add type= I or C also */ Label = 'Less_8';
... View more