|
Hi, Gabriela,
a) COMPUTE ignores filters. You could use IF like so:
STRING var_2 (A11).
COMPUTE var_2 = var_1. * Insert defective case number here. IF ($CASENUM = ...) var_2 = CONCAT(CHAR.SUBSTR(var_1,5,3),CHAR.SUBSTR(var_1,1,4), CHAR.SUBSTR(var_1,8,4)).
b) You can validate your date values on Regex101.
1. As a regular expression you type: \d\d\/[a-z]{3}\/20\d{2}
2. Copy your date values into the TEST STRING field like so:
18/Jan/2018 30/sep/2018 01/oct/2018 13/feb/2018 12/mar/2018 ...
Correctly formatted date values will be colored blue. Wrongly formatted date values will stay white and should be corrected.
| Regex101Firas Dib Online regex tester, debugger with highlighting for PHP, PCRE, Python, Golang and JavaScript. |
|
|
Mario Giesel Munich, Germany
Am Donnerstag, 22. August 2019, 01:20:27 MESZ hat gc_edelman < [hidden email]> Folgendes geschrieben:
Hi, I would like your help with a sintaxis. I, succesfully made a 'substring'
to a data variable. But then I discovered a wrong data in the order of month
and day. I am using the format: dd / mm / yyyy. But this unique data is: mm
/ dd / yyyy. So I made a filter in order to work just with this data.
First, the Filter is on.
And when I use the command:
compute var_2 = char.substr (var_1,1,2).
execute.
It takes ALL data, the filtered and not filtered ones..
I don't know if I am using the wrong command.
It is better with DO IF *
?
--
=====================
To manage your subscription to SPSSX-L, send a message to
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
|