OMS and labels in CTABLES

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

OMS and labels in CTABLES

progster
dear all, I would like to export to sav some ctables results, but once the data are exported I see generic column names: ColumnN ColumnN_A ColumnN_B. I would like to see as column name something relatated to data, such as area_a area_b area_c.

is that possible?

here's an example to clarify my situation

data list list / id * product (A3) area (A1) .
begin data
1 "P_1" "b"
2 "P_2" "a"
3 "P_2" "a"
4 "P_3" "c"
5 "P_4" "c"
6 "P_1" "a"
7 "P_1" "a"
8 "P_1" "b"
9 "P_1" "c"
10 "P_2" "b"
end data.

* OMS.
DATASET DECLARE  my_table.
OMS
 /SELECT TABLES
  /IF COMMANDS=['CTables'] SUBTYPES=['Custom Table']
  /DESTINATION FORMAT=SAV NUMBERED=TableNumber_
   OUTFILE='my_table'.

* Custom Tables.
CTABLES
  /VLABELS VARIABLES=product area DISPLAY=LABEL
  /TABLE product [COLPCT.COUNT PCT40.1] BY area
  /CATEGORIES VARIABLES=product area ORDER=A KEY=VALUE EMPTY=EXCLUDE.

omsend.
Reply | Threaded
Open this post in threaded view
|

Re: OMS and labels in CTABLES

Jignesh Sutar
OMS has a default way of naming columns which I don't believe is adjusatble. You can only after creation of OMS CTABLE dataset change variable names. I would do something like this (assuing you know how many area categories you shall have so to be able to specify Area_1 to Area_4):


dataset activate my_table.
numeric EndVar (f1.0).
rename variables (ColumnN to EndVar=Area_1 to Area_4).
add files file=* /drop=Area_4.






On 27 November 2015 at 10:48, progster <[hidden email]> wrote:
dear all, I would like to export to sav some ctables results, but once the
data are exported I see generic column names: ColumnN ColumnN_A ColumnN_B. I
would like to see as column name something relatated to data, such as area_a
area_b area_c.

is that possible?

here's an example to clarify my situation

data list list / id * product (A3) area (A1) .
begin data
1       "P_1"   "b"
2       "P_2"   "a"
3       "P_2"   "a"
4       "P_3"   "c"
5       "P_4"   "c"
6       "P_1"   "a"
7       "P_1"   "a"
8       "P_1"   "b"
9       "P_1"   "c"
10      "P_2"   "b"
end data.

* OMS.
DATASET DECLARE  my_table.
OMS
 /SELECT TABLES
  /IF COMMANDS=['CTables'] SUBTYPES=['Custom Table']
  /DESTINATION FORMAT=SAV NUMBERED=TableNumber_
   OUTFILE='my_table'.

* Custom Tables.
CTABLES
  /VLABELS VARIABLES=product area DISPLAY=LABEL
  /TABLE product [COLPCT.COUNT PCT40.1] BY area
  /CATEGORIES VARIABLES=product area ORDER=A KEY=VALUE EMPTY=EXCLUDE.

omsend.




--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/OMS-and-labels-in-CTABLES-tp5731060.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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

===================== 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