Difference in dates not working..proc report

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 97
Accepted Solution

Difference in dates not working..proc report

hi,

i am working some date functions ..but diff b.n the dates is showing some else in the column "days of delay"

the out put i.e report is attached in word document ...please let me what is the wrong with date function i used ?

please help.

regards

ALLU

the code is....................................

proc import dataFILE='C:\Users\galax_allu\Desktop\br1.csV'  dbms=csv out=allu.br2 replace ;

run;

data allu.br3 ;

set allu.br2 ;

format date1 ddmmyy10.;

informat date1 ddmmyy10.;

run;

%let t1=%sysfunc(today(),ddmmyy10.);

%PUT &T1;

proc report data=allu.br3 nowd headskip;

column brnum brname region (regname) bankname brokamt sheme  date1  tt;

title "Allu and co sub-borker company";

title  "Report for the day" &t1 ;

define brnum /  'brokerage number';

define brname / 'broker name' width =6;

define region/ DISPLAY 'region' ;

define regname / GROUP 'Region Belongs to' WIDTH=32;

define brokamt / analysis 'brokamt';

define sheme /  'SCHEME' STYLE=[FOREGROUND=YELLOW];

define date1/ display 'Date of Invoice';

define tt/ 'Days of delay' ;

BREAK AFTER REGNAME / SUMMARIZE ;

COMPUTE AFTER REGNAME;

REGNAME= TRIM(REGNAME)||' TOTAL ' ;

ENDCOMP;

compute tt ;

tt=intck(days,today(),date1);

endcomp;

COMPUTE SHEME;

IF SHEME="LP" THEN CALL DEFINE (_row_,'STYLE','STYLE=[FOREGROUND=RED]');

ENDCOMP;

compute after _page_ / style={bordertopcolor=black bordertopwidth=2};

line ' ';

endcomp;

RUN;

the out put i.e report is attached in word document ...please let me what is the wrong with date function i used ?


reportss.jpg

Accepted Solutions
Solution
‎10-26-2012 02:55 PM
PROC Star
Posts: 7,467

Re: Difference in dates not working..proc report

Posted in reply to allurai0412

Couple of possibilities.

First, in your use of the intck function, put quotes around days.  i.e.:

tt=intck('days',today(),date1);

Your title also has a problem.  Move the macro variable to within the quotes.  i.e.:

title  "Report for the day &t1." ;

View solution in original post


All Replies
Solution
‎10-26-2012 02:55 PM
PROC Star
Posts: 7,467

Re: Difference in dates not working..proc report

Posted in reply to allurai0412

Couple of possibilities.

First, in your use of the intck function, put quotes around days.  i.e.:

tt=intck('days',today(),date1);

Your title also has a problem.  Move the macro variable to within the quotes.  i.e.:

title  "Report for the day &t1." ;

Frequent Contributor
Posts: 97

Re: Difference in dates not working..proc report

thanks Mr Arthur

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 190 views
  • 0 likes
  • 2 in conversation