NOTE: LOST CARD

Reply
Occasional Contributor
Posts: 6

NOTE: LOST CARD

[ Edited ]

Hi all,

 

I am trying to append eight raw text files, each file holding data for one day. I am using the following code to automate this process.

 

data work.append (drop=d Yesterday Twodays Threedays Fourdays Fivedays
                               Sixdays Sevendays Eightdays);
     format Date mmddyy10.;
     Yesterday=put(intnx('day',today(),-1),mmddyy6.);
     Twodays=put(intnx('day',today(),-2),mmddyy6.);
     Threedays=put(intnx('day',today(),-3),mmddyy6.);
     Fourdays=put(intnx('day',today(),-4),mmddyy6.);
     Fivedays=put(intnx('day',today(),-5),mmddyy6.);
     Sixdays=put(intnx('day',today(),-6),mmddyy6.);
     Sevendays=put(intnx('day',today(),-7),mmddyy6.);
    Eightdays=put(intnx('day',today(),-8),mmddyy6.);
               do d=Yesterday, Twodays, Threedays, Fourdays, Fivedays, Sixdays, Sevendays, Eightdays;
                         NextFile=cats("E:\Users\XXXXXX\Desktop\output",d,".txt");
                         infile append filevar=Nextfile end=LastObs;
                                        do while (not LastObs);
                                                input @1 Provider $4.
                                                         @5 URL $40.
                                                         @45 Date yymmdd8.
                                                         @53 HHMM $4.
                                                         @57 ResCode $4.
                                                         @61 Counter 6.
                                                         @67 DNIS $6.
                                                         @73 Zip $5.
                                                         @81 CID $53.
                                                         @134 IP $39.
                                                         @173 City $17.
                                                        @190 Blanks1 $1.
                                                         @191 State $2.
                                                         @193 Source $20.
                                                         @213 Device $20.;
                                                                output;
                                         end;
                             end;
                             stop;
run;

 

proc print data=work.append (obs=5);
run;

 

The last three days of data (or three text files) append correctly. However, I then receive the following note in the log. Please see the NOTE: LOST CARD note listed below. Any suggestions? I replaced inspecific information with X's. Thanks, Eddie

 

1 data work.append (drop=d Yesterday Twodays Threedays Fourdays Fivedays
2 Sixdays Sevendays Eightdays);
3 format Date mmddyy10.;
4 Yesterday=put(intnx('day',today(),-1),mmddyy6.);
5 Twodays=put(intnx('day',today(),-2),mmddyy6.);
6 Threedays=put(intnx('day',today(),-3),mmddyy6.);
7 Fourdays=put(intnx('day',today(),-4),mmddyy6.);
8 Fivedays=put(intnx('day',today(),-5),mmddyy6.);
9 Sixdays=put(intnx('day',today(),-6),mmddyy6.);
10 Sevendays=put(intnx('day',today(),-7),mmddyy6.);
11 Eightdays=put(intnx('day',today(),-8),mmddyy6.);
12 do d=Yesterday, Twodays, Threedays, Fourdays, Fivedays, Sixdays, Sevendays,
12 ! Eightdays;
13 NextFile=cats("E:\Users\XXXXXXXX\Desktop\output",d,".txt");
14 infile append filevar=Nextfile end=LastObs;
15 do while (not LastObs);
16 input @1 Provider $4.
17 @5 URL $40.
18 @45 Date yymmdd8.
19 @53 HHMM $4.
20 @57 ResCode $4.
21 @61 Counter 6.
22 @67 DNIS $6.
23 @73 Zip $5.
24 @81 CID $53.
25 @134 IP $39.
26 @173 City $17.
27 @190 Blanks1 $1.
28 @191 State $2.
29 @193 Source $20.
30 @213 Device $20.;
31 output;
32 end;
33 end;
34 stop;
35 run;

NOTE: The infile APPEND is:
Filename=E:\Users\XXXXXXXX\Desktop\output041916.txt,
RECFM=V,LRECL=32767,
File Size (bytes)=143439560,
Last Modified=20Apr2016:11:42:25,
Create Time=20Apr2016:11:42:23

NOTE: The infile APPEND is:
Filename=E:\Users\XXXXXXX\Desktop\output041816.txt,
RECFM=V,LRECL=32767,File Size (bytes)=77058520,
Last Modified=20Apr2016:10:35:28,
Create Time=20Apr2016:10:35:27

NOTE: The infile APPEND is:
Filename=E:\Users\XXXXXXXX\Desktop\output041716.txt,
RECFM=V,LRECL=32767,File Size (bytes)=57131800,
Last Modified=20Apr2016:11:43:17,
Create Time=20Apr2016:11:43:17

NOTE: The infile APPEND is:
Filename=E:\Users\XXXXXXX\Desktop\output041616.txt,
RECFM=V,LRECL=327XX,
File Size (bytes)=106508820,
Last Modified=20Apr2016:11:44:35,
Create Time=20Apr2016:11:44:34

NOTE: LOST CARD.
Date=04/16/2016 Yesterday=041916 Twodays=041816 Threedays=041716 Fourdays=041616 Fivedays=041516
Sixdays=041416 Sevendays=041316 Eightdays=041216 d=041616
NextFile=E:\Users\XXXXXXX\output041616.txt LastObs=1 Provider=INHS URL=XXXXXXXXXXXXX
HHMM=1444 ResCode=LEAD Counter=1 DNIS= Zip=XXXXX CID=XXXXXXXXXXXXXXXXXXXX
IP=##.##.###.### City=Grand Prairie Blanks1= State=TX Source=unknown Device=XXXXXXXXXXXX
_ERROR_=1 _N_=1
NOTE: 651998 records were read from the infile APPEND.
The minimum record length was 219.
The maximum record length was 219.
NOTE: 350266 records were read from the infile APPEND.
The minimum record length was 219.
The maximum record length was 219.
NOTE: 259690 records were read from the infile APPEND.
The minimum record length was 219.
The maximum record length was 219.
NOTE: 484131 records were read from the infile APPEND.
The minimum record length was 219.
The maximum record length was 219.
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.APPEND has 873042 observations and 15 variables.
NOTE: DATA statement used (Total process time):
real time 0.86 seconds
cpu time 0.84 seconds


36
37 proc print data=work.append (obs=5);
NOTE: Writing HTML Body file: sashtml.htm
38 run;

NOTE: There were 5 observations read from the data set WORK.APPEND.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.34 seconds
cpu time 0.29 seconds

 

 

Contributor
Posts: 39

Re: NOTE: LOST CARD

I think your problem is that you are meaning to start from "Date" set to 4/16/16, but you are calculating the filenames from today(), which seems to have been 4/20/16.  From 4/20, you are calculating 4/19, 4/18, ..., 4/12/16 and looking for those files.  I suspect you mean to look for files with dates 4/15, 4/14, ..., 4/8.

 

I'd suggest that you rename variable Date to fromDate or something other than Date since that is a type in SAS.  You may want to make that a Macro variable that you can easily change.  e.g.

 

%let fromDate = '16Apr2016'd; * Up here it is easier to find and change;

 

data ...;
  format fromDate mmddyy10.;
  fromDate = &fromDate;

 

  Yesterday=put(intnx('day',  fromDate,-1), mmddyy6.);
  Twodays  =put(intnx('day'   fromDate,-2), mmddyy6.);
  Threedays=put(intnx('day', fromDate,-3), mmddyy6.);
  Fourdays =put(intnx('day',  fromDate,-4), mmddyy6.);
  Fivedays =put(intnx('day',   fromDate,-5), mmddyy6.);
  Sixdays  =put(intnx('day',    fromDate,-6), mmddyy6.);
  Sevendays=put(intnx('day', fromDate,-7), mmddyy6.);
  Eightdays=put(intnx('day',   fromDate,-8), mmddyy6.);

  . . .

 

Occasional Contributor
Posts: 6

Re: NOTE: LOST CARD

Posted in reply to Pamela_JSRCC
Thanks! That was part of the problem, but I rewrote the code to include the
truncover option. Adding this option removed the LOST CARD note.

##- Please type your reply above this line. Simple formatting, no
attachments. -##
Ask a Question
Discussion stats
  • 2 replies
  • 450 views
  • 0 likes
  • 2 in conversation