2
data RuntimeStats;
 length PgmName Status $100 PeopleNotified $ 400 AttachRowCount $4000
  ErrorFound $1000 unix_prcs_id $20 program_restart_step 8 Email_Subject $200
        dt_prcs_data $10;

 id=&nextid;
 userid_exec="&userid";
 unix_prcs_id="&sysjobid";
 PgmName="&PgmName";
 Status="RUNNING";
 PeopleNotified="";
 AttachRowCount="";
 Rundate=today();
 StartTime=input("&StartTime.",datetime23.);
 EndTime=.;
 ExecTime_min=.;
 ErrorFound="";
 program_restart_step=&program_step;
 dt_prcs_data="&dt_prcs_data";

 format id z10. Rundate mmddyy10. StartTime datetime23. EndTime datetime23. ExecTime_min;
 run;

 proc sql %if %upcase(&debug) eq Y %then %do; feedback %end; ;
   insert into rstats.runtimestats
   select id, userid_exec, unix_prcs_id, PgmName,put(&dt_prcs,mmddyy10.) as dt_prcs, "%superq(logfile)" as Log, Status, PeopleNotified, AttachRowCount,
          Rundate, StartTime, EndTime, ExecTime_min,ErrorFound, program_restart_step, Email_Subject, dt_prcs_data
   from RuntimeStats A;
 quit;

This code was running fine in SAS 9.1 and started throwing below WARNING in 9.3

WARNING: Character expression will be truncated when assigned to character column AttachRowCount.

SAS_learner
  • 521
  • 1
  • 13
  • 30
  • 1
    What length is the variable `attachrowcount` on the master table (rstats.runtimestats)? – Joe May 26 '15 at 21:27
  • @JOE I was researching this problem and your comment solved my question (before I need to write one.) Thank you sir. – George May 25 '18 at 15:29

1 Answers1

1

This seems to be an issue with upgrading to SAS 9.4 as you implied. Have a look at this:

According to their suggestions on that thread you would do something like substr(AttachRowCount,1,4000) length=4000 to capture the length (your earlier step specifies 4000) as below:

proc sql %if %upcase(&debug) eq Y %then %do; feedback %end; ;
   insert into rstats.runtimestats
   select id, userid_exec, unix_prcs_id, PgmName,put(&dt_prcs,mmddyy10.) as dt_prcs, "%superq(logfile)" as Log, Status, PeopleNotified, substr(AttachRowCount,1,4000) length=4000,
          Rundate, StartTime, EndTime, ExecTime_min,ErrorFound, program_restart_step, Email_Subject, dt_prcs_data
   from RuntimeStats A;
 quit;
Bendy
  • 3,506
  • 6
  • 40
  • 71