Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. klaz2002

    how can we filter on yyyymm in proc sql ?

    I think that you need to 'see' the actual value stored to get a sense on how to filter. SAS has two datatypes char and num. In your question you specify that the variable is type NUM. This indicates that the number stored is in numeric format. For you to 'see' this as a date value on display...
  2. klaz2002

    colon modifier (:) in array value and underscore(_in) in array variable name

    _in(*) is the name of the Array with the '*' as the number of vars in the Array. Using the asterisk allows the user to add vars to the Array dynamically. This way the programmer doesnt have to limit the Array width to a specific number of vars. Ex. Array _in(4) x1 x2 x3 x4; In the above Array...
  3. klaz2002

    Winzip Encryption via SAS

    I think that he/she mentioned this location so that SAS can launch via DDE (x command) the zip software. SAS opens the BAT file, a window execute program, that opens the ZIP maker.
  4. klaz2002

    Definitions / Examples

    You could look at the SAS help website. There are definitions as well as examples of each MACRO statement.
  5. klaz2002

    How to convert char(date) to date to get noumber of months

    ...the first of the month in question. So in your case May 1, 2013 Here is an example that presumes that your variable with the '20135' value is named mydate. proc sql; create table test as select *, input(mydate, yymmn6.) as mynewdate from mydataset ; quit; I hope that this helps you...
  6. klaz2002

    Looping Problem with Macro in SAS

    I think that you're mixing up MACRO and BASE. Remember, MACRO gets resolved before runtime. I don't think that your status variable would work. Do you always want to combine the 3 datasets? If yes why not just have the macro do a simple SET logic. %macro MyList(DataS1,DataS2,DataS3); data...
  7. klaz2002

    SAS 9 export into Excel 2003

    Why not use PROC EXPORT?
  8. klaz2002

    Birthdate calculation not working

    The intck function shouldn't be used to calculate age. My bad! The function returns the difference in years and not 365 day years. (Try Dec 20 XXXX and Jan 10 XXX+1) To get age use the first line in your post. Age = (DATE() - Birthdate) / 365.25; You can format the AGE var using the 8...
  9. klaz2002

    Attempting to calculate age in sas

    Why cant you do it with just using the INTCK function without all the rules? ex. age = intck('year',Birthdate,date());
  10. klaz2002

    FILENAME statement with %include

    No FILENAME and %INCLUDE are two different concepts. One is a MACRO substitution and the other is a BASE SAS statement. You use the %include (or %inc) statements for instances where you would like to include the code segment (at the include location) in your program. Think of it as a text...
  11. klaz2002

    Automatically Saving The Log File

    ...to reset the log to its default location or else the log will contain all log data of your SAS session and not just the particular program you want to see. Ex proc printto log='c:\test.log'; run; ***Your SAS code here ***; ***reset ***; proc printto; run; I hope that this helps you, Klaz
  12. klaz2002

    Renaming a list of variables

    You could use the PROC contents and save the out file. Then write a macro or even some base SAS code that would loop through the variables and generate the rename code. Then execute the code in a call execute. If you need more info let me know. If I have time later I can try and code it for...
  13. klaz2002

    SAS MACRO Errors...HELP!

    It seems from your description that the parm card value you pass to the macro variable named QTR is resolving too late. You need to have the QTR value set before the macro call executes. Perhaps if you copy the code and place it on here we can let you know how to modify the program. Klaz
  14. klaz2002

    What does ++ mean?

    CW, The first line acts as a filter and will only read the observations in the given range (+ 2 records ). The if workstn statement seems to be a not-equal operator (I haven't seen this as I use the caret (shift 6) ^= as the NE operator) Does this help? Klaz
  15. klaz2002

    Assistance with cleaning date variables in a data set

    why not use SAS's input function with the above mentioned formats? This way any date that doesnt meet the convention will end as a missing value. Then you 'know' all your bad date values. ex sasdatevalue = input(your_date_value,mmddyy10.); Klaz
  16. klaz2002

    Converting binary data

    Look into the SAS help for informats. There should be an informat that will convert your data into a decimal. Klaz
  17. klaz2002

    Create New Shortcut Key

    Why not use the Macro recording feature in the SAS editor? Select Tools-->record new macro Then click the line you want and copy (ctrl+c) then go to the next line and paste (ctrl+p) Then Select Tools --> stop recording Name your macro and assign the key that want (F12) Viola! you have your...
  18. klaz2002

    import strange datetime format

    Why not use the 'mdyampm' format? ex. sasdatetimevar = input(Yourdatevalue,mdyampm25.2); Klaz
  19. klaz2002

    Remove Commas

    ...the offending character string. In my example above I named that variable 'yourvar'. You need to place the compress() function in your datastep code. ex data yourdatasetname; set yourdssourcename; *** WILL REMOVE COMMAS FROM VARIABLE VALUE ***; yourvar = compress(yourvar,','); run...
  20. klaz2002

    Remove Commas

    You can remove the commas by using the compress() function or you can 'wrap' your values with quotes. ex 1 yourvar = compress(yourvar,','); ex 2 yourvar = '"'||trim(yourvar)||'"'; I hope that this helps you. klaz

Part and Inventory Search

Back
Top