SAS discussion board
Anyone have any idea how PROC SQL orders returned data for variables which have not been explicitly ordered or if there is a way of controlling it - for example with a many to many merge. Is there a rule about the order in which variables which are not explicitly part of the merge will be ? It does not seem to necessarily be the order in which they were in the source data. We are using SAS 9.3
With proc sort there is a system option (SORTEQUALS) which forces the order of the non sorted variables to be as in the source data but is there a similar control with proc sql ?
Good practice will be to explicitly include the desired order in the proc sql but just wondering if there is a solution that does not require a change to code (other than perhaps an option). The problem has arisen as part of a move to SAS Enterprise Guide. Oddly exactly the same proc sql code returns observations in a different order (within by group) if submitted from a display manager interface compared to if submitted from Enterprise Guide. I can't reproduce with a simple dummy example.
... View more