home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / bit / listserv / sasl / 3805 < prev    next >
Encoding:
Text File  |  1992-08-19  |  3.2 KB  |  90 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!LEICESTER.AC.UK!MAIL_SYSTEM
  3. Via: uk.ac.leicester; Thu, 20 Aug 1992 09:56:26 +0100
  4. Message-ID: <SAS-L%92082004562579@VTVM2.BITNET>
  5. Newsgroups: bit.listserv.sas-l
  6. Date:         Thu, 20 Aug 1992 09:56:00 GMT
  7. Reply-To:     Mail_System@LEICESTER.AC.UK
  8. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  9. From:         Mail_System@LEICESTER.AC.UK
  10. Subject:      %% Undelivered Mail %%
  11. Comments: To: SAS-L <SAS-L@VTVM2.CC.VT.EDU>
  12. Lines: 76
  13.  
  14. Your mail was not delivered as follows:
  15. Error reason: failed to make connection, entry deleted
  16.  
  17. Filename and information:
  18.  
  19. LEIC_WORD:[NETMGR]CBS_0095F5790B71.MAI;1
  20.  
  21. Your original mail header and message follow.
  22.  
  23. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  24. Via: UK.AC.NSFNET-RELAY; Wed, 19 Aug 92  18:52 GMT
  25. Received: from vtvm2.cc.vt.edu by sun3.nsfnet-relay.ac.uk with Internet SMTP
  26.           id <sg.02696-0@sun3.nsfnet-relay.ac.uk>;
  27.           Wed, 19 Aug 1992 18:24:42 +0100
  28. Received: from vtvm2.cc.vt.edu by VTVM2.CC.VT.EDU (IBM VM SMTP V2R2) with BSMTP
  29.           id 8324; Wed, 19 Aug 92 13:23:49 EDT
  30. Received: from VTVM2.BITNET by vtvm2.cc.vt.edu (Mailer R2.08 R208002)
  31.           with BSMTP id 1311; Wed, 19 Aug 92 13:23:39 EDT
  32. Date: Wed, 19 Aug 1992 12:10:28 -0500
  33. Reply-To: Kernon Gibes <gibes@COM.MONSANTO.SWIRL>
  34. Original-Sender: "SAS(r) Discussion" <SAS-L@EDU.VT.CC.VTVM2>
  35. From: Kernon Gibes <gibes@COM.MONSANTO.SWIRL>
  36. Subject: RE: SAS functions
  37. Comments: To: SAS-L@uga.cc.uga.edu@tin.monsanto.com
  38. Comments: cc: GIBES@tin.monsanto.com
  39. To: Multiple recipients of list SAS-L <SAS-L@EDU.VT.CC.VTVM2>
  40. Sender: SAS-L@EDU.VT.CC.VTVM2
  41.  
  42.  CONTENT:   Response (to "going back in time")
  43.  SUMMARY:   Try SAS function INTNX
  44.  REL/PLTF:  6.07/ VMS
  45.  E-ADDR:    gibes@swirl.monsanto.com
  46.  NAME:      Kernon Gibes
  47.  DATE:      19 August 1992
  48.  
  49.  Someone asked:
  50.  
  51. >I am using SAS functions, MOD and ABS. I don't get a right value.
  52. >I am trying to go to previous year based on the value in MO variable
  53. >Here is an example:
  54. <stuff deleted ---but copied below--->
  55.  
  56. >The value of tst2mo should be equal to NOV (11) and the value of tst2yr
  57. >should be equal to 75.  In another word, I am trying to subtract no. of months
  58. >reported in "mo" variable from tst1mo tst1yr variables to go back in time.
  59. >So if my first test date (tst1mo tst1yr) is JANUARY 1977 and I subtract (mo)
  60. >15 months from it I should get (tst2mo tst2yr) NOVEMBER 1975.
  61. <stuff deleted>
  62.  
  63.  It seems to me that Jan '77 minus 15 months would give you Oct '75.  If
  64.  so, instead of your code, you might use the SAS function INTNX as
  65.  illustrated below:
  66.  
  67.    data one;
  68.      mo = 15;
  69.      tst1mo = 1;
  70.      tst1yr = 77;
  71.      tempmo = mod(mo,12);
  72.      tst2mo = abs(tst1mo - tempmo);
  73.      tempyr = int(mo/12);
  74.      tst2yr = tst1yr - tempyr;
  75.      tst2_dt = mdy(tst2mo,01,tst2yr);
  76.      put 'Original:  ' tst2_dt= date7.;
  77.    /*** replace MOD, ABS, etc., with INTNX ***/
  78.      date1 = mdy( tst1mo,01,tst1yr);
  79.      back = intnx( 'month', date1, -mo );
  80.      put 'Corrected: ' back= date7.;
  81.  
  82.    stop;
  83.    run;
  84.  
  85. Original:  TST2_DT=01FEB76
  86. Corrected: BACK=01OCT75
  87.  
  88. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  89. End of returned mail
  90.