Hi,
I am getting the following error and I cannot tell what is wrong with input data.
NOTE: 3993 records were read from the infile 'zkqmmm9.mq.jcl.deadq.data(data1)'.
NOTE: The data set WORK.DEADQ has 3509 observations and 5 variables.
NOTE: The DATA statement used 0.01 CPU seconds and 19772K.
NOTE: The address space has used a maximum of 888K below the line and 23320K above the line.
2 The SAS System
NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
11:9
NOTE: Invalid numeric data, qmgr='QT93' , at line 11 column 9.
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT=MQXXXX count=1 _ERROR_=1 _N_=1
NOTE: Invalid numeric data, qmgr='QT93' , at line 11 column 9.
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT=MQYYYY count=1 _ERROR_=1 _N_=2
NOTE: Invalid numeric data, qmgr='QT93' , at line 11 column 9.
hdr=DLH rc=2081 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT=MQDEAD count=1 _ERROR_=1 _N_=3
NOTE: Invalid numeric data, qmgr='QT93' , at line 11 column 9.
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT=MQDEAD count=1 _ERROR_=1 _N_=4
NOTE: Invalid numeric data, qmgr='QT93' , at line 11 column 9.
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT=MQDEAD count=1 _ERROR_=1 _N_=5
NOTE: Invalid numeric data, qmgr='QT93' , at line 11 column 9.
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT=MQDEAD count=1 _ERROR_=1 _N_=6
NOTE: Invalid numeric data, qmgr='QT93' , at line 11 column 9.
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT=MQDEAD count=1 _ERROR_=1 _N_=7
NOTE: Invalid numeric data, qmgr='QT93' , at line 11 column 9.
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT=MQDEAD count=1 _ERROR_=1 _N_=8
NOTE: Invalid numeric data, qmgr='QT93' , at line 11 column 9.
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT=MQDEAD count=1 _ERROR_=1 _N_=9
NOTE: Invalid numeric data, qmgr='QT93' , at line 11 column 9.
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT=MQDEAD count=1 _ERROR_=1 _N_=10
NOTE: Invalid numeric data, qmgr='QT93' , at line 11 column 9.
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT=MQDEAD count=1 _ERROR_=1 _N_=11
Thank you. Unfortunately, this gives no additional hints. Did you actually try my suggestions ...
length qmgr $ 5;
This statement goes BEFORE the INPUT statement.
IF QMGR = " " THEN QMGR = 'LOCAL';
This statement replaces the current statement that is problematic.
attach my sas program
Why would you attach the program as a file? Use the Insert SAS Code icon in the forum editor.
OPTIONS LS=256 NOSOURCE NOSOURCE2 NOFMTERR nocenter;
options nodate pageno=1 pagesize=60 ;
data deadq;
infile 'zkqmmm9.mq.jcl.deadq.data(data1)';
input hdr $ 21-23 rc $ 25-29 queue $ 33-75 qmgr $ 81-84
FORMAT $ 102-111
;
IF HDR ne 'DLH' THEN DELETE;
data temp1; set deadq;
count=1;
IF QMGR =. THEN QMGR = 'LOCAL';
RUN;
Why would you attach a few lines of text as a file? Using the Insert Code icon in the forum editor.
******************************************************* Top of Data ******************************************************** 1 2019/069 SAMPLE QUEUE REPORT PAGE 0001 - MESSAGE QUEUE MANAGER NAME : QT93 QUEUE NAME : RQP.DEAD.LETTER.QUEUE.SIT - RELATIVE MESSAGE - NUMBER LENGTH --------------------------------- MESSAGE DATA --------------------------------- 00000001 00005724 DLH 2085 RQP.RPST.EVENT.REQ.CIT QT93 MQXXXX 00000002 00006315 DLH 2085 RQP.RPST.EVENT.REQ.CIT QT93 MQYYYY 00000003 00001598 DLH 2081 RQP.RPST.EVENT.REQ.CIT QT93 MQDEAD 00000004 00002027 DLH 2085 RQP.RPST.EVENT.REQ.CIT QT93 MQDEAD 00000005 00000675 DLH 2085 RQP.RPST.EVENT.REQ.CIT QT93 MQDEAD
Why are you using two data steps? And if you are why didn't you end the first one with a RUN statement to make the code easier for humans to read?
data deadq;
infile 'zkqmmm9.mq.jcl.deadq.data(data1)' truncover ;
input hdr $ 21-23 rc $ 25-29 queue $ 33-80 qmgr $ 81-101
FORMAT $ 102-111
;
IF HDR ne 'DLH' THEN DELETE;
count=1;
IF QMGR = ' ' THEN QMGR = 'LOCAL';
RUN;
When I read through the log, it tells me ... Oh, wait. I can't read the log. Maybe you should post it.
OK, the program tells me enough. The problem is in this step:
data temp1; set deadq;
count=1;
IF QMGR =. THEN QMGR = 'LOCAL';
RUN;
There are two issues here. First, this not the way to check if a character variable is missing. You would need:
if qmgr = " " then qmgr = 'LOCAL';
Also, the length of QMGR is set at $4 in the initial DATA step. THere is no way to store all five characters in "LOCAL". You can change that easily enough:
data temp1;
length qmgr $ 5;
set deadq;
count=1;
IF QMGR = " " THEN QMGR = 'LOCAL';
RUN;
Still, I suspect that the log would tell me more.
OPTIONS LS=256 SOURCE NOSOURCE2 NOFMTERR nocenter; options nodate pageno=1 pagesize=60 ; data deadq; infile 'zkqmmm9.mq.jcl.deadq.data(data1)'; input hdr $ 21-23 rc $ 25-29 queue $ 33-75 qmgr $ 81-84 FORMAT1 $ 102-111 ; IF HDR ne 'DLH' THEN DELETE; count=1; IF QMGR =. THEN QMGR = 'LOCA'; RUN; PROC SUMMARY DATA=deadq n print; CLASS queue qmgr rc FORMAT1; VAR count; RUN;
NOTE: 1064704K bytes were available above the line after adjustment for MEMLEAVE=512K.
NOTE: The initialization phase used 0.03 CPU seconds and 16840K.
NOTE: The address space has used a maximum of 888K below the line and 19724K above the line.
1 OPTIONS LS=256 SOURCE NOSOURCE2 NOFMTERR nocenter;
2 options nodate pageno=1 pagesize=60 ;
3 data deadq;
4 infile 'zkqmmm9.mq.jcl.deadq.data(data1)';
5 input hdr $ 21-23 rc $ 25-29 queue $ 33-75 qmgr $ 81-84
6 FORMAT1 $ 102-111
7 ;
8 IF HDR ne 'DLH' THEN DELETE;
9 count=1;
10 IF QMGR =. THEN QMGR = 'LOCA';
11 RUN;
NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
10:7
NOTE: The infile 'zkqmmm9.mq.jcl.deadq.data(data1)' is:
2 The SAS System
Dsname=ZKQMMM9.MQ.JCL.DEADQ.DATA(DATA1),
Unit=3390,Volume=9SD#D1,Disp=SHR,Blksize=32718,
Lrecl=133,Recfm=FB,Creation=2019/03/09
NOTE: Invalid numeric data, qmgr='QT93' , at line 10 column 7.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
8 CHAR 00000001 00005724 DLH 2085....RQP.RPST.EVENT.REQ.CIT QT93
ZONE 44FFFFFFFF4FFFFFFFF4CDC4FFFF0002DDD4DDEE4CECDE4DCD4CCE44444444444444444444444444DEFF4444444444444444
NUMR 00000000010000057240438020850085987B9723B55553B958B3930000000000000000000000000083930000000000000000
101 MQXXXX ........................
ZONE 4DDEEEE44000000000000000000000000
NUMR 048777700000000000000000000000000
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT1=MQXXXX count=1 _ERROR_=1 _N_=8
NOTE: Invalid numeric data, qmgr='QT93' , at line 10 column 7.
9 CHAR 00000002 00006315 DLH 2085....RQP.RPST.EVENT.REQ.CIT QT93
ZONE 44FFFFFFFF4FFFFFFFF4CDC4FFFF0002DDD4DDEE4CECDE4DCD4CCE44444444444444444444444444DEFF4444444444444444
NUMR 00000000020000063150438020850085987B9723B55553B958B3930000000000000000000000000083930000000000000000
101 MQYYYY ........................
ZONE 4DDEEEE44000000000000000000000000
NUMR 048888800000000000000000000000000
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT1=MQYYYY count=1 _ERROR_=1 _N_=9
NOTE: Invalid numeric data, qmgr='QT93' , at line 10 column 7.
10 CHAR 00000003 00001598 DLH 2081....RQP.RPST.EVENT.REQ.CIT QT93
ZONE 44FFFFFFFF4FFFFFFFF4CDC4FFFF0002DDD4DDEE4CECDE4DCD4CCE44444444444444444444444444DEFF4444444444444444
NUMR 00000000030000015980438020810085987B9723B55553B958B3930000000000000000000000000083930000000000000000
101 MQDEAD ........................
ZONE 4DDCCCC44000000000000000000000000
NUMR 048451400000000000000000000000000
hdr=DLH rc=2081 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT1=MQDEAD count=1 _ERROR_=1 _N_=10
NOTE: Invalid numeric data, qmgr='QT93' , at line 10 column 7.
11 CHAR 00000004 00002027 DLH 2085....RQP.RPST.EVENT.REQ.CIT QT93
ZONE 44FFFFFFFF4FFFFFFFF4CDC4FFFF0002DDD4DDEE4CECDE4DCD4CCE44444444444444444444444444DEFF4444444444444444
NUMR 00000000040000020270438020850085987B9723B55553B958B3930000000000000000000000000083930000000000000000
101 MQDEAD ........................
ZONE 4DDCCCC44000000000000000000000000
NUMR 048451400000000000000000000000000
hdr=DLH rc=2085 queue=RQP.RPST.EVENT.REQ.CIT qmgr=LOCA FORMAT1=MQDEAD count=1 _ERROR_=1 _N_=11
NOTE: Invalid numeric data, qmgr='QT93' , at line 10 column 7.
12 CHAR 00000005 00000675 DLH 2085....RQP.RPST.EVENT.REQ.CIT QT93
ZONE 44FFFFFFFF4FFFFFFFF4CDC4FFFF0002DDD4DDEE4CECDE4DCD4CCE44444444444444444444444444DEFF4444444444444444
NUMR 00000000050000006750438020850085987B9723B55553B958B3930000000000000000000000000083930000000000000000
101 MQDEAD ........................
ZONE 4DDCCCC44000000000000000000000000
NUMR 048451400000000000000000000000000
Thank you. Unfortunately, this gives no additional hints. Did you actually try my suggestions ...
length qmgr $ 5;
This statement goes BEFORE the INPUT statement.
IF QMGR = " " THEN QMGR = 'LOCAL';
This statement replaces the current statement that is problematic.
I changed QMGR to 4 bytes.
IF QMGR =. THEN QMGR = 'LOCA';
Is that good enough?
Thanks David
No. That's the wrong way to refer to a missing value for a character variable. Use a blank with quotes around it.
thanks for the solution. Did not pay attention to " ". the error message has pointed to the other direction.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.