Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open file in SPSS with 2 variables #12

Closed
pcholewa opened this issue Sep 25, 2018 · 10 comments
Closed

Cannot open file in SPSS with 2 variables #12

pcholewa opened this issue Sep 25, 2018 · 10 comments

Comments

@pcholewa
Copy link

Hi!

When save file with below config, i cannot open saved file in SPSS - application hangs.

BUT, saved file opens success when:

-remove all variable 1 or 2
OR
-remove "width" from first variable
OR
-remove "values" from second variable

Anyone can help me? What i do wrong?

My code:
$writer = new \SPSS\Sav\Writer([
'header' => [
'prodName' => '@(#) ' . $this->analysis->getName(),
'layoutCode' => 2,
'compression' => 1,
'weightIndex' => 0,
'creationDate' => date('Y-m-d'),
'creationTime' => date('H:i:s'),
],
'variables' => [
[
'name' => 'aaa',
'width' => 16,
'format' => 1,
],
[
'name' => 'cc',
'format' => 5,
'values' => [
1 => 'Panel',
]
],
]
]);
$pathFile = 'spss.sav';
$writer->save($pathFile);

@tiamo
Copy link
Owner

tiamo commented Sep 27, 2018

Hi! Have you tried without compression ?

@pcholewa
Copy link
Author

without compression still does not work, any more idea?

@pcholewa
Copy link
Author

pcholewa commented Oct 1, 2018

Probably it's something wrong with writer. When i open saved (with writer) file, there are difference in array of variables - precisely in "print" and "write".
Additionally, when (in above code) i reverse order of variables it's open successfully in SPSS.

Can You check that? I would be very grateful :)

@tiamo
Copy link
Owner

tiamo commented Oct 5, 2018

Probably it's something wrong with writer. When i open saved (with writer) file, there are difference in array of variables - precisely in "print" and "write".
Additionally, when (in above code) i reverse order of variables it's open successfully in SPSS.

Can You check that? I would be very grateful :)

I have released new version 2.1.0, try to update and check.

@pcholewa
Copy link
Author

pcholewa commented Oct 5, 2018

Unfortunately don't work. Have you try save .sav with example of my first post?

@tiamo tiamo closed this as completed in d3ce30e Oct 5, 2018
@tiamo
Copy link
Owner

tiamo commented Oct 5, 2018

@pcholewa try again, I have updated the code.

@tiamo tiamo reopened this Oct 5, 2018
@pcholewa
Copy link
Author

pcholewa commented Oct 8, 2018

It works! Thank You very much!

@tiamo tiamo closed this as completed Dec 14, 2018
@pcholewa
Copy link
Author

reopen, after last changes you apply this issue not working. Can You check that?

@pcholewa
Copy link
Author

pcholewa commented Jan 28, 2019

sorry, my fault, Your current 2.1.0 version not working, last changes from dev-master#cc710d53358f5b1f4ad9626cb21608c78ab09336 works fine!

Can You merge that?

@tiamo
Copy link
Owner

tiamo commented Jan 28, 2019

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants