Hi,
I have a workflow in sas,it will generate the results and save those results on local machine.
After I ran next time,I have to backup this file and generate new results with this file.
Later I have to compare these two results.how can I do this in sas?....somebody help me.
Thanks,
Rk.
I think that you have to provide more info. You can make files to be permanent by simply creating them as a two level name, i.e., libname.yourfilename. You can also rename files and find out if files exist.
Thus, if you don't need the files to be permanent, it may be as simple as creating a file, say, called new.
Then, when you run your code first check to see if 'new' exists and, if it does, rename it to be 'old'. Then create a new 'new' and compare it with 'old'.
However, I am just guessing as to what you are really trying to do. More info would be helpful.
Hi,
I want to make files to be permanent by simply creating them as a two level name, i.e., libname.yourfilename. You can also rename files and find out if files exist.
I want to proceed with above code......can you send me sample code.
Thanks,
rk.
art127,
sorry,they want all the results(i mean each time i ran) that has to be stored in a dataset with header and footer.i have attached the file with example.
then i have to give two prompts for dates for comparing results.......in the prompt dropdown,i have to give all dates which are there in the header part of dataset.
Header: generated report on 08/15/2011. | |||||||
Speciality Pharmacy | Milestone Period | Raw Total | Less:Missing Product Code | Less:Missing Milestone Date | Less:Missing Date and Product | ||
ACS | 8/1/2010 | 13398 | 902 | 0 | 3112 | ||
ASRX | 8/1/2010 | 39078 | 10 | 1901 | 92 | ||
Accredo | 8/1/2010 | 158570 | 0 | 44042 | 0 | ||
Caremark | 8/1/2010 | 220015 | 0 | 22998 | 38450 | ||
CuraScript | 8/1/2010 | 96000 | 7876 | 754 | 58 | ||
Diplomat | 8/1/2010 | 12034 | 313 | 1599 | 0 | ||
Humana | 8/1/2010 | 5094 | 0 | 4603 | 0 | ||
Pharmacare | 8/1/2010 | 8249 | 0 | 42 | 5 | ||
PrecisionRX | 8/1/2010 | 61805 | 1 | 575 | 114 | ||
PrescriptionSolutions | 8/1/2010 | 51233 | 14 | 30928 | 28 | ||
USOncology | 8/1/2010 | 7118 | 0 | 5749 | 0 | ||
Walgreens | 8/1/2010 | 89694 | 0 | 20408 | 17370 | ||
Footer: generated report on 08/15/2011. | |||||||
Header: generated report on 08/16/2011. | |||||||
Speciality Pharmacy | Milestone Period | Raw Total | Less:Missing Product Code | Less:Missing Milestone Date | Less:Missing Date and Product | ||
ACS | 8/1/2010 | 13399 | 903 | 0 | 3112 | ||
ASRX | 8/1/2010 | 39078 | 10 | 1901 | 92 | ||
Accredo | 8/1/2010 | 158570 | 0 | 44042 | 0 | ||
Caremark | 8/1/2010 | 220015 | 0 | 22998 | 38450 | ||
CuraScript | 8/1/2010 | 96000 | 7876 | 754 | 58 | ||
Diplomat | 8/1/2010 | 12034 | 313 | 1599 | 0 | ||
Humana | 8/1/2010 | 5094 | 0 | 4603 | 0 | ||
Pharmacare | 8/1/2010 | 8249 | 0 | 42 | 5 | ||
PrecisionRX | 8/1/2010 | 61805 | 1 | 575 | 114 | ||
PrescriptionSolutions | 8/1/2010 | 51233 | 14 | 30928 | 28 | ||
USOncology | 8/1/2010 | 7118 | 0 | 5749 | 0 | ||
Walgreens | 8/1/2010 | 89694 | 0 | 20408 | 17370 | ||
Footer: generated report on 08/16/2011. |
Thanks,
Bhavani.
Sounds like the filenames are not the relevant issue but, more so, what the resulting file has to look like. Without seeing the files one can only guess, but my guess is you will need proc report or proc tabulate, bringing in the two different files, summarizing them, and printing the results with headers and footers that incorporate the infiles.
As neither are my specialty, I'll leave suggesting the necessary code to others to help you with.
Hi,
I have one program which will generate error list for specified period.
Each time i ran that program results should be stored in the dataset with header and footnotes(is header and footnote possible for dataset?)
dataset:
Header: generated report on 08/15/2011. | |||||||
Speciality Pharmacy | Milestone Period | Raw Total | Less:Missing Product Code | Less:Missing Milestone Date | Less:Missing Date and Product | ||
ACS | 8/1/2010 | 13398 | 902 | 0 | 3112 | ||
ASRX | 8/1/2010 | 39078 | 10 | 1901 | 92 | ||
Accredo | 8/1/2010 | 158570 | 0 | 44042 | 0 | ||
Caremark | 8/1/2010 | 220015 | 0 | 22998 | 38450 | ||
CuraScript | 8/1/2010 | 96000 | 7876 | 754 | 58 | ||
Diplomat | 8/1/2010 | 12034 | 313 | 1599 | 0 | ||
Humana | 8/1/2010 | 5094 | 0 | 4603 | 0 | ||
Pharmacare | 8/1/2010 | 8249 | 0 | 42 | 5 | ||
PrecisionRX | 8/1/2010 | 61805 | 1 | 575 | 114 | ||
PrescriptionSolutions | 8/1/2010 | 51233 | 14 | 30928 | 28 | ||
USOncology | 8/1/2010 | 7118 | 0 | 5749 | 0 | ||
Walgreens | 8/1/2010 | 89694 | 0 | 20408 | 17370 | ||
Footer: generated report on 08/15/2011. | |||||||
Header: generated report on 08/16/2011. | |||||||
Speciality Pharmacy | Milestone Period | Raw Total | Less:Missing Product Code | Less:Missing Milestone Date | Less:Missing Date and Product | ||
ACS | 8/1/2010 | 13399 | 903 | 0 | 3112 | ||
ASRX | 8/1/2010 | 39078 | 10 | 1901 | 92 | ||
Accredo | 8/1/2010 | 158570 | 0 | 44042 | 0 | ||
Caremark | 8/1/2010 | 220015 | 0 | 22998 | 38450 | ||
CuraScript | 8/1/2010 | 96000 | 7876 | 754 | 58 | ||
Diplomat | 8/1/2010 | 12034 | 313 | 1599 | 0 | ||
Humana | 8/1/2010 | 5094 | 0 | 4603 | 0 | ||
Pharmacare | 8/1/2010 | 8249 | 0 | 42 | 5 | ||
PrecisionRX | 8/1/2010 | 61805 | 1 | 575 | 114 | ||
PrescriptionSolutions | 8/1/2010 | 51233 | 14 | 30928 | 28 | ||
USOncology | 8/1/2010 | 7118 | 0 | 5749 | 0 | ||
Walgreens | 8/1/2010 | 89694 | 0 | 20408 | 17370 | ||
Footer: generated report on 08/16/2011. |
Then based on dates on header we have to create two promts with all the dates.....what ever dates they selected we have to generate the results.
ex: date1...08/15/2011
date2...08/16/2011
outputfile1:
Speciality Pharmacy | Milestone Period | Raw Total | Less:Missing Product Code | Less:Missing Milestone Date | Less:Missing Date and Product | ||
ACS | 8/1/2010 | 13398 | 902 | 0 | 3112 | ||
ASRX | 8/1/2010 | 39078 | 10 | 1901 | 92 | ||
Accredo | 8/1/2010 | 158570 | 0 | 44042 | 0 | ||
Caremark | 8/1/2010 | 220015 | 0 | 22998 | 38450 | ||
CuraScript | 8/1/2010 | 96000 | 7876 | 754 | 58 | ||
Diplomat | 8/1/2010 | 12034 | 313 | 1599 | 0 | ||
Humana | 8/1/2010 | 5094 | 0 | 4603 | 0 | ||
Pharmacare | 8/1/2010 | 8249 | 0 | 42 | 5 | ||
PrecisionRX | 8/1/2010 | 61805 | 1 | 575 | 114 | ||
PrescriptionSolutions | 8/1/2010 | 51233 | 14 | 30928 | 28 | ||
USOncology | 8/1/2010 | 7118 | 0 | 5749 | 0 | ||
Walgreens | 8/1/2010 | 89694 | 0 | 20408 | 1737 |
outputfile2:
Speciality Pharmacy | Milestone Period | Raw Total | Less:Missing Product Code | Less:Missing Milestone Date | Less:Missing Date and Product | ||
ACS | 8/1/2010 | 13399 | 903 | 0 | 3112 | ||
ASRX | 8/1/2010 | 39078 | 10 | 1901 | 92 | ||
Accredo | 8/1/2010 | 158570 | 0 | 44042 | 0 | ||
Caremark | 8/1/2010 | 220015 | 0 | 22998 | 38450 | ||
CuraScript | 8/1/2010 | 96000 | 7876 | 754 | 58 | ||
Diplomat | 8/1/2010 | 12034 | 313 | 1599 | 0 | ||
Humana | 8/1/2010 | 5094 | 0 | 4603 | 0 | ||
Pharmacare | 8/1/2010 | 8249 | 0 | 42 | 5 | ||
PrecisionRX | 8/1/2010 | 61805 | 1 | 575 | 114 | ||
PrescriptionSolutions | 8/1/2010 | 51233 | 14 | 30928 | 28 | ||
USOncology | 8/1/2010 | 7118 | 0 | 5749 | 0 | ||
Walgreens | 8/1/2010 | 89694 | 0 | 20408 | 1737 |
can someone help me on this issue.
Thanks,
rk.
Hi Rk,
As per my understanding , when you save the those result in your local system just add the &systime (automatic macro var) in the outfile name. So whenever you run those code it will gennerate different outfile .
And for compare import the previous outfile and using PROC COMPARE compare it with the present .
Hope it'll help..
ani,
i'm not comparing files in sas........i just have to send two files to them......previous ran results and current.
With date stamp with file they can't able to use that file in spot-fire it seems.
Thanks,
Bhavani.
"results should be stored in the dataset with header and footnotes(is header and footnote possible for dataset?"
The dataset can not hold title or footnote if you want to keep different variables too.
But you can use data step to put the result into a txt or csv file.
Or use ODS to product different type file .
Ksharp
sasG
are you seeking a way to compare two reports (not sas data sets)?
If so, how do you want to show the differences?
It may be possible for SAS to create the report of differences in a much reduced style, if these changes happens slowly.
Perhaps it might be better (if most rows change on each report run) to add a "change since last report" column.
How is the current report produced? Is it Web Report Studio, or on the SAS Portal?
hth
peterC
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.