Problem Statement: I have a text file and I want to read it using SAS INFILE function. But SAS is not giving me the proper output.
Text File:
1 Big Bazar 15,000
2 Hypercity 20,000
3 Star Bazar 25,000
4 Big Basket 30,000
5 Grofers 35,000
6 DMart 40,000
The Code that I have tried:
DATA Profit;
INFILE '/folders/myfolders/Akki/Retain_Sum.txt';
INPUT Month $1 Name $3-12 Profit;
Informat Profit COMMA6.;
FORMAT Profit COMMA6.;
RETAIN Cummulative_Profit;
Cummulative_Profit = SUM(Cummulative_Profit, Profit);
Run;
PROC PRINT data=profit;
Run;
What am I looking for? I want to read above data in SAS but it seems there is a problem in my code. (Whenever I run my code it gives some missing value in the profit variable of Grofers and DMart observation). Can you fix it? I want SAS to read complete file. Thanks in advance.