I am new to SAS but had done some programming in past; I am given a task to migrate SAS program written on PC SAS v8 to run under UNIX (HP-UX) SAS v8.
As per SAS claim, codes should be compatible and only data requires some migration; I thought it will be easy job, but realized only after going in-depth in to migration.
Approximately 2000 line PC SAS code is only reading permanent datasets and creating some output files (HTML); I have gone in and changed all references which were specific to PC, changed some excel files in to CSV files; data reading is working fine.
BUT this code does a lot of data manipulation using DATA STEP MERGE, PROC SQL, PROC MEAN only in temporary datasets, create empty datasets, merge datasets with no observations.
These steps work fine on PC SAS but are failing on UNIX especially when you merge multiple datasets with one without any observation.
Please let me know if I am missing anything or if you have seen similar issues.
I would really appreciate any tip; I have been trying to fix but it is very tedious and time consuming. Any trick or tip to trouble shoot real cause of this different behavior will be greatly appreciated.
You will need to share exact SAS log output and executed code prior and at the error point in your SAS program. Without this information, it's a guessing game to debug your error condition. Reply to your post and paste the information (SAS code should be revealed for forum subscribers feedback).
It is almost 1700 lines code; BTW, I have kind of figured out the issue.
UNIX SAS in batch mode enters in to "Syntax Check" mode even on some of semantic error in SAS code and it will stop updating even temporary datasets. As I didn't see SYNTAXCHECK option part of SAS program or in system config file, I was not aware of this behavior.
I found this by running the same code in interactive mode, although program had some logical errors but it still got through.
Any suggession or tip under this situation? I think I can use NOSYNTAXCHECK as part of program to avoid entering to this mode but this option has some risks.
I know with this option, updates on datasets can be corrupted; but if we only read datasets, can this option be used safely?
Also how can we check or dump system options (default, set by system config file or set by program) and their status with in a program for debugging?
You mentioned SAS errors/warnings/problems so you will need to share specifics, preferably from your SAS Log output just prior and up to the error condition - and maybe even just after as well. For this, you will need to turn on OPTIONS SOURCE SOURCE2; and if you have macros or macro variables, add MACROGEN SYMBOLGEN MPRINT as well.
It's a guessing game to respond to unidentified processing problems with specific details on symptoms. Your other option is to contact SAS support and open a track to provide them problem/symptom details and look for guidance.
You can use SAS PROC OPTIONS; to display the current CONFIG options settings at any point in your SAS application code.