Hi Guys, First I should preface this post with the fact that I am using 9.1.3, so all the relevant constraints of using such an old version apply. A little bit of history about this task: Everyday, I recieve a file containing a snapshot of what the all the accounts look like at the end of the day. Each account can have multiple products which could be considered sub accounts. The extract date in the below example is created by me and is actually just a suffix attached to each of the TXT files that I recieve. There is no date or indicator within the dataset that states that a transaction took place today (so I can't simply subset the data based on date and append to the history file that I am creating). What I need to do is create a History file containing any movements that took place compared to the most recent in the previous days History file. I have tried using both the UPDATE statement in a datastep and a Hash Object, but for obvious reasons this doesn't work (the obvious reason being that if the accounts changes from 1000 on Day1 to 2000 on Day2 then back to 1000 on Day3, we end up updating the record from Day1). Could someone please help me formulate a solution for this issue? Thank you for your help. DATA DAY1; INFILE DATALINES; INPUT ACCNO BALANCE PRODUCT $ EXTRACTDATE : DATE9.; FORMAT EXTRACTDATE DATE9.; DATALINES; 1 1000 P1 01OCT2014 1 1000 P2 01OCT2014 2 2000 P1 01OCT2014 2 1000 P2 01OCT2014 3 9000 P1 01OCT2014 4 7000 P1 01OCT2014 5 4000 P1 01OCT2014 6 5000 P1 01OCT2014 7 10000 P1 01OCT2014 ; RUN; DATA DAY2; INFILE DATALINES; INPUT ACCNO BALANCE PRODUCT $ EXTRACTDATE : DATE9.; FORMAT EXTRACTDATE DATE9.; DATALINES; 1 10000 P1 02OCT2014 1 3000 P2 02OCT2014 2 4000 P1 02OCT2014 2 5000 P2 02OCT2014 3 6000 P1 02OCT2014 4 7000 P1 02OCT2014 5 8000 P1 02OCT2014 6 9000 P1 02OCT2014 7 10000 P1 02OCT2014 8 15000 P1 02OCT2014 ; RUN; DATA DAY3; INFILE DATALINES; INPUT ACCNO BALANCE PRODUCT $ EXTRACTDATE : DATE9.; FORMAT EXTRACTDATE DATE9.; DATALINES; 1 1000 P1 03OCT2014 1 1000 P2 03OCT2014 2 2000 P1 03OCT2014 2 1000 P2 03OCT2014 3 9000 P1 03OCT2014 4 7000 P1 03OCT2014 5 4000 P1 03OCT2014 6 5000 P1 03OCT2014 7 10000 P1 03OCT2014 ; RUN; DATA DESIRED; INFILE DATALINES dlm=","; INPUT ACCNO BALANCE PRODUCT $ EXTRACTDATE : DATE9.; FORMAT EXTRACTDATE DATE9.; DATALINES; 1,1000,P1,01OCT2014 1,1000,P2,01OCT2014 1,3000,P2,02OCT2014 1,10000,P1,02OCT2014 2,1000,P2,01OCT2014 2,2000,P1,01OCT2014 2,4000,P1,02OCT2014 2,5000,P2,02OCT2014 3,6000,P1,02OCT2014 3,9000,P1,01OCT2014 4,7000,P1,01OCT2014 5,4000,P1,01OCT2014 5,8000,P1,02OCT2014 6,5000,P1,01OCT2014 6,9000,P1,02OCT2014 7,10000,P1,01OCT2014 8,15000,P1,02OCT2014 1,1000,P1,03OCT2014 1,1000,P2,03OCT2014 2,2000,P1,03OCT2014 2,1000,P2,03OCT2014 3,9000,P1,03OCT2014 4,7000,P1,03OCT2014 5,4000,P1,03OCT2014 6,5000,P1,03OCT2014 7,10000,P1,03OCT2014 ; RUN; PROC SORT DATA = DESIRED OUT = DESIRED; BY ACCNO BALANCE PRODUCT; RUN;
... View more