Hi,
I have this code that produces a list as I want. In IMSACT1, there are repeating values that I want to summarize together. Summarizing IMSACT1 also means summarizing the time variable ISUCPUTM to get the total CPU TM for IMSACT1. I tried using SUM IMSACT1 ; but it doesnt like it.
What should I be using instead?
//MICSPROC JCLLIB ORDER=(CPM.M.CX.TST.PROCLIB)
// EXEC MICSSHR2 <<<-- IMS UNIT
//SYSIN DD *
PROC PRINT DATA=DAYS.IMSISU01;
BY SYSID ;
VAR IMSACT1 IMSACT2 IMSACT5 ISUCPUTM ;
TITLE 'IMS TESTING';
RUN;
Thanks,
Alvin
but it doesnt like it.
This isn't enough for us to go on. Show us the LOG (the entire log for this step, the code as it appears in the LOG, plus all ERRORs, WARNINGs and NOTEs). Copy the log as text and paste it into the box that appears when you click on the </> icon.
What does your title mean about summing character variables? You cannot sum "ABC" with "DEF". This requires explanation too.
Hi thanks for the reply. I I was incorrect when I said i wanted to summarize. I was thinking "summarizing aaa, aaa, aaa, to just one aaa" but GROUP BY sounds like what I want.
This is the output now:
Obs IMSACT2 ISUCPUTM
34784 QBQ1 0:00:03.15
34785 QBQ1 0:00:00.00
34786 GQJR 0:00:00.00
34787 GQJR 0:00:00.01
34788 GQJR 0:00:00.01
34789 GQJR 0:00:00.01
34790 GQJR 0:00:00.01
34791 GQJR 0:00:00.01
34792 GQJR 0:00:00.02
34793 GQJR 0:00:00.03
34794 GQJR 0:00:00.01
34795 GQJR 0:00:00.01
34796 GQJR 0:00:00.01
34797 GQJR 0:00:00.03
34798 GQJR 0:00:00.01
34799 GQJR 0:00:00.00
I want all the GQJR to be GROUPed together. Will the associated ISUCPUTM automatically be summarized by using GROUP BY?
So I just tried this but no dice:
//MICSPROC JCLLIB ORDER=(CPM.M.CX.TST.PROCLIB)
// EXEC MICSSHR2 <<<-- IMS UNIT
//SYSIN DD *
PROC PRINT DATA=DAYS.IMSISU01;
BY SYSID ;
VAR IMSACT2 ISUCPUTM ;
GROUP BY IMSACT2 ;
TITLE 'IMS TESTING';
RUN;
Here is the log. Says it doesn't like the GROUP:
1010 + GROUP BY IMSACT2 ;
_____
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
11 The SAS System 11:45 Wednesday, October 7, 2020
NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M3)
Licensed to CIGNA CORPORATE SERVICES LLC/TEST, Site 70002680.
NOTE: This session is executing on the z/OS V02R03M00 platform.
NOTE: Additional host information:
IBM 3906-707, HSYS, FMID HBB77B0, CPU: 11, GP: 7, zAAP: 0, zIIP: 4
NOTE: SAS system options specified are:
S=72 SYSIN=SASIN SYSPARM=' '
NOTE: 64M bytes were available above the line at initialization.
NOTE: 8256K bytes were available below the line at initialization.
NOTE: 65024K bytes were available above the line after adjustment for MEMLEAVE=512K.
NOTE: The initialization phase used 0.01 CPU seconds and 17886K.
NOTE: The address space has used a maximum of 1432K below the line and 20956K above the line.
NOTE: The DATA statement used 0.00 CPU seconds and 22271K.
NOTE: The address space has used a maximum of 1432K below the line and 26288K above the line.
NOTE: The DATA statement used 0.00 CPU seconds and 22364K.
NOTE: The address space has used a maximum of 1432K below the line and 27292K above the line.
NOTE: Copying MCOLIBIN.MICSFMTS to MCOLIB.MICSFMTS (memtype=CATALOG).
NOTE: Copying MCOLIBIN.USERFMT1 to MCOLIB.USERFMT1 (memtype=CATALOG).
NOTE: Copying MCOLIBIN.USERFMT2 to MCOLIB.USERFMT2 (memtype=CATALOG).
NOTE: The PROCEDURE COPY used 0.05 CPU seconds and 28768K.
NOTE: The address space has used a maximum of 1432K below the line and 32936K above the line.
NOTE: Libref MCOLIBIN has been deassigned.
NOTE: The DATA statement used 0.00 CPU seconds and 27616K.
NOTE: The address space has used a maximum of 1432K below the line and 33416K above the line.
NOTE: The DATA statement used 0.00 CPU seconds and 27616K.
NOTE: The address space has used a maximum of 1432K below the line and 33416K above the line.
12 The SAS System 11:45 Wednesday, October 7, 2020
NOTE: Copying MUOLIBIN.MICSFMTS to MUOLIB.MICSFMTS (memtype=CATALOG).
NOTE: Copying MUOLIBIN.SASMACR to MUOLIB.SASMACR (memtype=CATALOG).
NOTE: Copying MUOLIBIN.USERFMT1 to MUOLIB.USERFMT1 (memtype=CATALOG).
NOTE: Copying MUOLIBIN.USERFMT2 to MUOLIB.USERFMT2 (memtype=CATALOG).
NOTE: The PROCEDURE COPY used 0.00 CPU seconds and 28640K.
NOTE: The address space has used a maximum of 1432K below the line and 33628K above the line.
NOTE: Libref MUOLIBIN has been deassigned.
NOTE: The DATA statement used 0.00 CPU seconds and 28128K.
NOTE: The address space has used a maximum of 1432K below the line and 34744K above the line.
BASFMTSR: FMTSEARCH=(WORK.FORMATS MCOLIB.USERFMT1 MCOLIB.MICSFMTS MCOLIB.USERFMT2 MUOLIB.USERFMT1 MUOLIB.MICSFMTS MUOLIB.USERFMT2
LIBRARY.FORMATS)
NOTE: The DATA statement used 0.00 CPU seconds and 28128K.
NOTE: The address space has used a maximum of 1432K below the line and 34744K above the line.
NOTE: The DATA statement used 0.00 CPU seconds and 28128K.
NOTE: The address space has used a maximum of 1432K below the line and 34744K above the line.
NOTE: The DATA statement used 0.00 CPU seconds and 28128K.
NOTE: The address space has used a maximum of 1432K below the line and 36280K above the line.
NOTE: The DATA statement used 0.00 CPU seconds and 28128K.
NOTE: The address space has used a maximum of 1432K below the line and 36280K above the line.
NOTE: The infile DBCONFIG is:
Dsname=CPM.M.I2.TST.PARMS(DBCONFIG),
Unit=3390,Volume=M4MC17,Disp=SHR,Blksize=6160,
Lrecl=80,Recfm=FB,Creation=2019/05/29
NOTE: 111 records were read from the infile DBCONFIG.
One or more lines were truncated.
NOTE: The DATA statement used 0.01 CPU seconds and 28508K.
NOTE: The address space has used a maximum of 1436K below the line and 36280K above the line.
NOTE: The infile EXECDEF is:
Dsname=CPM.M.I2.TST.PARMS(EXECDEF),
13 The SAS System 11:45 Wednesday, October 7, 2020
Unit=3390,Volume=M4MC17,Disp=SHR,Blksize=6160,
Lrecl=80,Recfm=FB,Creation=2019/05/29
NOTE: 18 records were read from the infile EXECDEF.
One or more lines were truncated.
NOTE: The DATA statement used 0.01 CPU seconds and 28636K.
NOTE: The address space has used a maximum of 1436K below the line and 36280K above the line.
NOTE: The infile SYSIN is:
Dsname=TJUM.TJUMCONT.JOB02188.D0000101.?,
Unit=SYSOUT,Volume,Disp=NEW,Blksize=80,
Lrecl=80,Recfm=FB,Creation=2020/10/07
NOTE: 1 record was read from the infile SYSIN.
NOTE: The DATA statement used 0.00 CPU seconds and 28636K.
NOTE: The address space has used a maximum of 1436K below the line and 36280K above the line.
NOTE: The DATA statement used 0.00 CPU seconds and 28658K.
NOTE: The address space has used a maximum of 1440K below the line and 36280K above the line.
NOTE: The infile JCLPFX is:
Dsname=CPM.M.I2.TST.USER.SOURCE(PREFIX),
Unit=3390,Volume=M4MC14,Disp=SHR,Blksize=6160,
Lrecl=80,Recfm=FB,Creation=2019/05/29
NOTE: 1 record was read from the infile JCLPFX.
One or more lines were truncated.
NOTE: The DATA statement used 0.00 CPU seconds and 28658K.
NOTE: The address space has used a maximum of 1440K below the line and 36280K above the line.
SETGBLS: MICSMODE=PRE4600 USWITCH=YES DBIDLIST=2
MAPDDIA: DDIAMP2 macro invoked to build DD name macros
1010 + GROUP BY IMSACT2 ;
_____
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: The PROCEDURE PRINT used 0.00 CPU seconds and 32208K.
NOTE: The address space has used a maximum of 1440K below the line and 37204K above the line.
ERROR: SAS ended due to errors.
You specified: OPTIONS ERRORABEND;.
14 The SAS System 11:45 Wednesday, October 7, 2020
ERROR: Errors printed on page 3.
NOTE: The SAS session used 0.20 CPU seconds and 32208K.
NOTE: The address space has used a maximum of 1440K below the line and 37204K above the line.
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
Thanks
Alvin
We only need the LOG for the PROC PRINT part of your program.
Show us the LOG (the entire log for this step, the code as it appears in the LOG, plus all ERRORs, WARNINGs and NOTEs).
You may need to use this before you run the code.
options source;
Where should this line go?
options source;
Also, on the mainframe, it shows only SASLOG.
The other 2 are system related. This is the log I always use when debugging.
Thanks
It should be the first line of your program; or if you feel better putting it just before PROC PRINT, that would work in this case.
It will probably help get a better answer by providing some example data and what the result should be.
One suspects that Proc Means/Summary to get the summary might be more in line but specifics are in the data.
Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.