BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rfarmenta
Obsidian | Level 7

I am using QDS and ACASI to collect data and one of the benefits is that when I export data from the program, formats are attached to the data file. How do I save the formats in new cleaned sas files that I create for analysis and to send to other people to use? Rigth now when I send someone the clean data I created and saved using a libname statement, none of the formats are attached so they have to delete them to use the file otherwise they get errors. Any suggestions would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
jakarman
Barite | Level 11

see the QDS documentation about formats. There should a SAS export dataset and a SAS program (.sas) containing the formats.

http://www.novaresearch.com/products/QDS/QDS_Manual_2-4.pdf (pag 195)

Within SAS formats are more implemted like a program doing the formatting of values.

By that it is easier to reuse that once you have defined that and made permanent available.

This is a big advantage as standard setup. It even can act as lookup and doing more without to change the data. 

The disadvantage is the maintenance of this code-like artifacts.

---->-- ja karman --<-----

View solution in original post

10 REPLIES 10
jakarman
Barite | Level 11

see the QDS documentation about formats. There should a SAS export dataset and a SAS program (.sas) containing the formats.

http://www.novaresearch.com/products/QDS/QDS_Manual_2-4.pdf (pag 195)

Within SAS formats are more implemted like a program doing the formatting of values.

By that it is easier to reuse that once you have defined that and made permanent available.

This is a big advantage as standard setup. It even can act as lookup and doing more without to change the data. 

The disadvantage is the maintenance of this code-like artifacts.

---->-- ja karman --<-----
rfarmenta
Obsidian | Level 7

I know that QDS has the option to export the datasets and formats into sas, but they use SAS transport files for sas version 8.0, I am using version 9.3. Will this cause problems? I actually export out of the QDS warehouse into SPSS and read the SPSS file, with formats, into SAS. I am not sure why Nova hasn't updated their SAS exporting procedures.

jakarman
Barite | Level 11

SAS should be able to import old style transport files. The SAS code of the formats you should a also have.

It is documented SAS will use the 6.12 structure  when degression SAS eg from 9.3 to 9.2.

By now you have hit a design difference between SPSS and SAS. This is bringing you into the formats trouble. 
With SAS you are needing to the two described datasets. 

---->-- ja karman --<-----
ballardw
Super User

If you are getting an *.SAS file that has Proc Format statements you have three main options.

1) Send the Format code to your users and have them run it.

2) Run the format code with the cntlout option to create a set that can create a dataset that can rebuild the formats and send that along with the data and instructions to run Proc Format with the CNTLIN option to create the formats in their system.

3) Use proc cport to export the format catalog, but this may not work if they are on a different OS.

Since formats only affect display of values and do not affect the actuall values in the data set there isn't much to clean up.

My person choice as a user receiving such things is the first one above. I can then more easily modify the code if I find the supplied versions clunky or not quite to my taste.

If they are using the data and gettine errors of "Format not found" then the quicker fix is OPTION NOFMTERR;

rfarmenta
Obsidian | Level 7

Thank you for the information. I was able to get the transport files to work for the data and am not trying to get the formats to work. I keep getting the error, "ERROR: This range is repeated, or values overlap: 9-9.", when reading the formats provided by QDS into sas.

LinusH
Tourmaline | Level 20

Then perform option 2 suggested by ballardw.

Data never sleeps
ballardw
Super User

The error messange indicates that at least one of the formats is defined incorrectly. The values shown, 9-9. , means most likely that 9 is included in another range within the same format, such as 1-10, within the proc format code. The format immediately above the error message in the log is the culprit. Adust the ranges and resubmit the format code and things should be okay. IF you have lots of these then the source application has a bug.

rfarmenta
Obsidian | Level 7

I was informed by the company that there is an error in how they export the formats for SAS and am downloading the patch and hope that will work. We have over 1500 variables so I do not want to have to create formats myself. Jaap, I do want to use the formats, I think I accidentally put "not" instead of "now" in my last response, sorry about that. Thanks again everyone for your help. 

jakarman
Barite | Level 11

Does not matter for typo-s, I make them often. And by that the wishfull thinking/hope it is kept understandable. Smiley Wink

---->-- ja karman --<-----
jakarman
Barite | Level 11

But if you do not want to use formats... why did you ask for them as a problem in your Original question

---->-- ja karman --<-----

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 10 replies
  • 1014 views
  • 6 likes
  • 4 in conversation