Help using Base SAS procedures

ERROR: Format/Informat

Reply
N/A
Posts: 0

ERROR: Format/Informat

I am working with SAS in a mainframe environment - OS/390. The program that is being executed stops processing with the following error:

ERROR: Format/Informat $OPFMT. could not be located.


when attempting to execute the last line of the following code:


LIBNAME FORMATS 'C.SAS.FORMAT6' DISP=SHR;

OPTIONS FMTSEARCH=(FORMATS WORK);

LIBNAME RECVBL6 'C.SAS.RECVBL6.DATA' DISP=SHR;
LIBNAME RECVBL6A 'C.SAS.RECVBL6A.DATA' DISP=SHR;

PROC SORT DATA=OPDATA;
BY KEY75 KEY76 INVOICE;

PROC SORT DATA=CUSTDATA;
BY KEY75 KEY76 INVOICE;

DATA OPDATA ;
MERGE OPDATA CUSTDATA;
BY KEY75 KEY76 INVOICE;
PROC SORT DATA=OPDATA OUT=OPFMT NODUPKEY;
BY DEALER DIV INVOICE;

DATA OPFMT;
LENGTH DEALER $6 INVOICE $10;
SET OPFMT END=EOF;
RETAIN FMTNAME 'OPFMT' TYPE 'C' LABEL 'YES';
START=DEALER||DIV||INVOICE;
OUTPUT;
IF EOF;
HLO='O';
LABEL='NO';
OUTPUT;

PROC FORMAT CNTLIN=OPFMT;

DATA RECVBL;
SET RECVBL6.UNITS(IN=A);
WHERE PUT(DEALER||DIV||INVOICE,$OPFMT.)='YES';
Super Contributor
Posts: 260

Re: ERROR: Format/Informat

Hi.
There must be an error before, when executing the Format procedure : the $OPFMT. is not created.
I think there is something wrong in the Data step defining the format : the conditionnal part (IF EOF) sould be applied to the next statements. I suggest you try this instead :
[pre]
DATA OPFMT;
LENGTH DEALER $6 INVOICE $10;
SET OPFMT END=EOF;
RETAIN FMTNAME 'OPFMT' TYPE 'C' LABEL 'YES';
START=DEALER||DIV||INVOICE;
OUTPUT;
IF EOF THEN DO ;
HLO='O';
LABEL='NO';
OUTPUT;
END ;
RUN ;
PROC FORMAT CNTLIN=OPFMT FMTLIB ;
RUN ;
[/pre]
The FMTLIB option will allow you to check the format definition in the Output window.

Regards,
Olivier
Frequent Contributor
Posts: 139

Re: ERROR: Format/Informat

Pasting the entire log would be helpful.
N/A
Posts: 0

Re: ERROR: Format/Informat

Here is the log:

NOTE: The infile ESS is:
Dsname=W.W8PD.ESS.HIST.EXTR.G0887V00(0),
Unit=9348,Volume=508973,Disp=OLD,Blksize=23220,
Lrecl=540,Recfm=FB

NOTE: 7507981 records were read from the infile ESS.
NOTE: The data set WORK.OPDATA has 0 observations and 8 variables.
NOTE: The data set WORK.CUSTDATA has 0 observations and 9 variables.
NOTE: The DATA statement used 22.63 CPU seconds and 3900K.

61 +PROC SORT DATA=OPDATA;
62 + BY KEY75 KEY76 INVOICE;
63 +

WARNING: WER749I No observations to be sorted.
NOTE: WER750I End PROC SYNCSORT. R2.3B*
NOTE: The data set WORK.OPDATA has 0 observations and 8 variables.
NOTE: The PROCEDURE SORT used 0.01 CPU seconds and 4599K.
3 The SAS System


64 +PROC SORT DATA=CUSTDATA;
65 + BY KEY75 KEY76 INVOICE;
66 +

WARNING: WER749I No observations to be sorted.
NOTE: WER750I End PROC SYNCSORT. R2.3B*
NOTE: The data set WORK.CUSTDATA has 0 observations and 9 variables.
NOTE: The PROCEDURE SORT used 0.01 CPU seconds and 4599K.

67 +DATA OPDATA ;
68 + MERGE OPDATA CUSTDATA;
69 + BY KEY75 KEY76 INVOICE;
70 +

NOTE: The data set WORK.OPDATA has 0 observations and 13 variables.
NOTE: The DATA statement used 0.01 CPU seconds and 4559K.
71 +PROC SORT DATA=OPDATA OUT=OPFMT NODUPKEY;
72 + BY DEALER DIV INVOICE;
73 +

WARNING: WER749I No observations to be sorted.
NOTE: WER750I End PROC SYNCSORT. R2.3B*
NOTE: The data set WORK.OPFMT has 0 observations and 13 variables.
NOTE: The PROCEDURE SORT used 0.01 CPU seconds and 5243K.

74 +DATA OPFMT;
75 + LENGTH DEALER $6 INVOICE $10;
76 + SET OPFMT END=EOF;
77 + RETAIN FMTNAME 'OPFMT' TYPE 'C' LABEL 'YES';
78 + START=DEALER||DIV||INVOICE;
79 + OUTPUT;
80 + IF EOF;
81 + HLO='O';
82 + LABEL='NO';
82 + LABEL='NO';
83 + OUTPUT;
84 +

NOTE: The data set WORK.OPFMT has 0 observations and 18 variables.
NOTE: The DATA statement used 0.01 CPU seconds and 5203K.

85 +PROC FORMAT CNTLIN=OPFMT;
85 +
86 +

NOTE: The PROCEDURE FORMAT used 0.00 CPU seconds and 5250K.

87 +DATA RECVBL;
88 + SET RECVBL6.UNITS(IN=A);
89 + WHERE PUT(DEALER||DIV||INVOICE,$OPFMT.)='YES';
ERROR: Format/Informat $OPFMT. could not be located.
ERROR: Format/Informat $OPFMT. could not be located.
ERROR: Format/Informat $OPFMT. could not be located.
90 + KEEP DEALER ACCTIND INVOICE INVYR SS SECTION VERSION SERVICE
91 + LIQDATE LIQCODE TOTINVT;
92 +
93 +

NOTE: The SAS System stopped processing this step because of errors.
Super Contributor
Super Contributor
Posts: 3,174

Re: ERROR: Format/Informat

For consideration, if it is possible to have a "zero observations selected for your format", then you should consider outputting a "stub" format so that your PUT function look-up does not fail. One technique I might use is to code a PROC FORMAT execution and only specify an OTHER='???'; clause -- obviously you will want to put this code ahead of the PROC FORMAT CNTLIN=...; step so that if there are observations selected, your final SAS format will be complete, not the generated stub.

Scott Barry
SBBWorks, Inc.
Super Contributor
Posts: 260

Re: ERROR: Format/Informat

As the log says (in the beginning of your messages) :
NOTE: The data set WORK.OPDATA has 0 observations and 8 variables.
NOTE: The data set WORK.CUSTDATA has 0 observations and 9 variables.
You datasets are empty from the beginning !
Look for some condition impossible to meet in the import part of the program (the DATA step before the two SORT procedures.
Did that program ever work ?
Ask a Question
Discussion stats
  • 5 replies
  • 123 views
  • 0 likes
  • 4 in conversation