BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

Hello, 

 

I am not famillar with _IORC_ at all and trying to understand the logic of a SAS developper absent for few months.

 

PROC DATASETS NOLIST LIBRARY= temp;
MODIFY histo_gc_auto_norisk;
/* INDEX DELETE _ALL_;*/
INDEX CREATE COMPKEY=(AGREEMENT_NBR DATEMISS DATECHEA) / UNIQUE NOMISS;
RUN;

DATA TEMP.Auto TEMP.A; set TEMP.A; RCLASS3=RCLASS2; if RCLASS2 NE 'PERSAUTO' THEN OUTPUT; ELSE DO; SET temp.histo_gc_auto_norisk KEY=COMPKEY/UNIQUE; IF _IORC_ THEN DO; OUTPUT; END; ELSE DO; RCLASS2 ='COMMAUTO'; RCLASS2P='COMMIRCA'; OUTPUT; END; END; RUN;

The begining seems strange:

 

DATA TEMP.Auto TEMP.A; set TEMP.A;

and based on the script everything goes in both datasets.

Does someone can help me with that?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

The WARNING is a result of preceding ERRORs, usually caused by invalid data. You need to check those.

I think that a _IORC_ value of zero means success, but that's a guess. As described in the documentation I linked, use %SYSRC to see the real numeric value for SOK.

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

As you observe, the DATA step creates two identical datasets (none of the OUTPUT statements is tied to a specific dataset).

It uses a SET with KEY and checks the automatic variable _IORC_ for a non-zero value (= true) to do nothing, or set two variables in case of a zero value (= false). According to this, this usage is not completely future-proof.

I guess(!) that the variables need to be set if a match is found. Today, I would use a hash object for this.

alepage
Barite | Level 11

so, if we make the hypothesis that records with none unique key get a _IORC_ value of zero because for the same agreement_nbr they have multiple datemiss and datechea, and in that case the two variables RCLASS2 AND RCLASS2P need to be remapped to new values.

 

and how to deal with warning ?

WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.
GCNA_BRANCH= DATECHEA=25-11-04 DATEMISS=24-11-04 DATANNUL=. ASSPREC=WA BASETAR=1 CIEDISTR= CODEFPQ=1 COURTIER=0024 DATEORIG=201811
AGREEMENT_NBR=aaa-4315 POL_SYNC=M27-9337 POL_TEST= PRIMANNU=775 PROFGAFF=SECRETAIRE COMPTABLE RAIS_SOC=IN SECTASSU=P SERVICE=
SOURCAFF=N STATUT=N TERR_REP=04 POLICE=aaa315- TERME=- PROVINCE=QC POL_CONV=P BROKER_GROUP_IND= PIP=1 POLICY=aaa4315 ANASS=6
NEWREN=R RCLASS2=COMMAUTO RCLASS2P=COMMIRCA PRIORCUR=C TRANS=DIR MOIS=202509 FPROV=QC. CIE=A TRANSFER=R RCLASS3=PERSAUTO
POLICY_INCEPTION_DT= POLICY_EXPIRY_DT= GENRE_GC= _ERROR_=1 _IORC_=1230015 _N_=1

 

 

How to see the value of each _IORC_

Kurt_Bremser
Super User

The WARNING is a result of preceding ERRORs, usually caused by invalid data. You need to check those.

I think that a _IORC_ value of zero means success, but that's a guess. As described in the documentation I linked, use %SYSRC to see the real numeric value for SOK.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 80 views
  • 1 like
  • 2 in conversation