Login  Register

Re: Split File and OMS Output

Posted by Andy W on Mar 26, 2015; 12:15pm
URL: http://spssx-discussion.165.s1.nabble.com/Split-File-and-OMS-Output-tp5729063p5729072.html

Are you perhaps using SPLIT FILE SEPARATE? Because if you use SPLIT FILE LAYERED it does return a variable associating the specific split in the output table. Example below - in the second table Var1 holds the split file fields.

**************************************************.
SET SEED 10.
INPUT PROGRAM.
LOOP #j = 1 TO 10.
  LOOP #i = 1 TO 10.
    COMPUTE Cat = #j.
    COMPUTE X = RV.NORMAL(#j,#j).
    END CASE.
  END LOOP.
END LOOP.
END FILE.
END INPUT PROGRAM.
DATASET NAME TEST.
FORMATS Cat (F2.0).
VALUE LABELS Cat 1 'Test 1' 2 'Test 2' 3 'BLLLLLL'.

*This returns seperate tables, so there is no identfier.
DATASET DECLARE DescTab.
OMS
  /SELECT TABLES
  /IF SUBTYPES = 'Descriptive Statistics'
  /DESTINATION FORMAT=SAV OUTFILE='DescTab'.
SPLIT FILE SEPARATE BY Cat.
DESCRIPTIVES X.
SPLIT FILE OFF.
OMSEND.

*This returns a variable in the table associating it to the split.
DATASET DECLARE DescTab2.
OMS
  /SELECT TABLES
  /IF SUBTYPES = 'Descriptive Statistics'
  /DESTINATION FORMAT=SAV OUTFILE='DescTab2'.
*The default is LAYERED.
SPLIT FILE BY Cat.
DESCRIPTIVES X.
SPLIT FILE OFF.
OMSEND.
**************************************************.
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/