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 SkipVought 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. mdieckman

    SAS Macro variable in a valid var name all name (i.e. SAS var w space)

    Nevermind, I figured it out: "First Name&cnt."n
  2. mdieckman

    SAS Macro variable in a valid var name all name (i.e. SAS var w space)

    I have the need to create a variable name with a space and add a macro variable to the end. I'm having a bit of trouble with the syntax. I have really simplified my example as not to get into the other complexities of my program. Essentially, I want the variable name to resolve to First Name1...
  3. mdieckman

    Changing numeric to character

    You need to make the column either a character or number in all datasets. It sounds like in your case you want to go to number to character. In that case, you need an input function. data x; set x; x = 1; y = input(left(x),$1.); run;
  4. mdieckman

    SAS to Excel using DDE, cell formatting

    I always just created a macro in excel. Have SAS launch the excel (excel has digital signature to avoid macro warning). Then have SAS call said macro and have Excel do the formatting with VBA. Have the VBA save and close, and then have SAS go back to whatever else you need to do.
  5. mdieckman

    Count unique codes by group

    Oh, and if some don't have the '|', you could do the index function to make sure and then use an If, then statement. So, basically: if index(name,'|') > 0 then rcount = (statement above); else 0;
  6. mdieckman

    Count unique codes by group

    You just count the number of "|" and subtract 1? data x; set master; rcount =(length(Name)-length(compress(Name,"|"))) - 1; run; compress removes the '|' from whatever the variable is leaving you with the number of '|'. Since there is an extra '|' just subtract one. There would be other ways...
  7. mdieckman

    Emailing Data From a Dataset

    Oops, sorry- Should be: data _null_; set data1 (firstobs=2 obs=2); CALL SYMPUT ('var1',var1); run;
  8. mdieckman

    Emailing Data From a Dataset

    Yes, it's in possible. It depends on how many observations you have, but if it's only 1 or you know which (you could use firstobs = n obs = n to get the one you want. Use symput: data _null_; CALL SYMPUT ('var1',var1); run; and then use the macro variable (&var1) in your e-mail statement...
  9. mdieckman

    SAS Escape Sequence

    Try single quotes. I.e. a_new_string = 'John said, "How are you?"'; I'm not at work though so couldn't test that, but I think that's how you would do it.
  10. mdieckman

    A list of customers with only one order

    If your data is in a SAS dataset (you could also do something similar on a database or if you have a counter for orders you could also sum that variable): PROC SQL; CREATE TABLE EXTRACT.ONE_ORDER AS (SELECT A.CUSTOMER ,A.MEMBER_NUM ,COUNT(A.MEMBER_NUM) AS MEMBER_COUNT FROM...
  11. mdieckman

    Mail On a Condition

    I would imagine that it is n_obs is probably 0 hence it callling the statement. What does your put statement say? put n_obs=; should output it to the log. Also, your email is blank probably because you aren't placing anything in the variable test. Best would to use a macro variable. Called as...
  12. mdieckman

    SAS Programming on Mainframe

    Thanks for the reply... I did figure out what I needed to do before you replied. Did find a fairly good resource though... too bad these forums aren't as busy as they used to be... http://ibmmainframes.com/
  13. mdieckman

    SAS Programming on Mainframe

    I'm a PC SAS programmer, but I've been asked to learn Mainframe using JCL / TSO. I was wondering if there were any resources or guides someone could point me to so I could get started. I'm kind of wading my way through here blindly and have some program examples, but I think it would be helpful...
  14. mdieckman

    Append ODS HTML

    So, do I have this right - you have the original dataset and you have another dataset you want to add more records to? If so, why not just do a proc append, and output the file again? proc append base=work.original data=work.new; run;
  15. mdieckman

    PROC SQL Pass through MS ACCESS

    I suppose you provided enough info... libname a "S:\LAB STATS 09_10.mdb"; options validvarname=any; PROC SQL; CREATE TABLE A.DS AS (select A.* FROM A.'E_Q Data CNTs'n as A ); QUIT; options validvarname=v7; I don't have SAS in front of me though so I...
  16. mdieckman

    PROC SQL Pass through MS ACCESS

    Try the validvarname any option. This allows spaces in table names. Also, try connecting to your access db as a libname. Sorry just paraphrasing on the code, but hopefully this will move you in the right direction. libname a "C:/access.mdb"; options validvarname=any; proc sql... from...
  17. mdieckman

    Need help with sql

    Sorry - the alias on the join for seller should say as C not B again. This part needs corrected: LEFT OUTER JOIN EXTRACT.Order as C ON A.Seller_Order_No = C.Order_No
  18. mdieckman

    Need help with sql

    Here is one way: This will basically keep all values from transaction and pull in the prices from the order file without dropping anything. I'm not sure if I have interpreted exactly what you need, but hopefully this example will get you what you need or at least get you started. This can...
  19. mdieckman

    Need help with sql

    Could you post a sample of the data in both tables? Without that - it's hard to see how you are trying to join. Here's a generic example of an equal join: Note: "Extract" is my defined library. PROC SQL; CREATE TABLE EXTRACT.FINAL AS (SELECT A.* ,B.* FROM EXTRACT.FILE1...
  20. mdieckman

    SAS PROC SQL UPDATE

    Oops, sorry for the typos.

Part and Inventory Search

Back
Top