BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
HansSteenhuis
Calcite | Level 5

Is this possible in EC? If something changes in the test result, it must continue to give the value "semi_start" within the test number in the column EG_RESULT

 

See example:


Thank you very much for the comments

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

@HansSteenhuis 

Just a SAS datastep creating the data is easiest for "us". I'm using SAS on a remote server and though would have to upload any SAS file prior to using it. 

Below Have table created via the EG import wizard.

DATA have;
    LENGTH
        TESTNUMBER         8
        DATE               8
        RESULT           $ 4
        EG_RESULT        $ 10 ;
    FORMAT
        TESTNUMBER       BEST12.
        DATE             DATE9.
        RESULT           $CHAR4.
        EG_RESULT        $CHAR10. ;
    INFORMAT
        TESTNUMBER       BEST12.
        DATE             DATE9.
        RESULT           $CHAR4.
        EG_RESULT        $CHAR10. ;
    INFILE DATALINES4
        DLM='7F'x
        MISSOVER
        DSD ;
    INPUT
        TESTNUMBER       : BEST32.
        DATE             : BEST32.
        RESULT           : $CHAR4.
        EG_RESULT        : $CHAR10. ;
DATALINES4;
112520870GOODstart
112520909GOODstart
112520940GOODstart
112521027GOODstart
112521109GOODstart
112521250GOODstart
112521361GOODstart
112521465GOODstart
112521549GOODstart
112521654GOODstart
112521703GOODstart
254820979GOODstart
254821026GOODstart
254821066GOODstart
254821158GOODstart
254821448XXXsemi_start
254821466XXXsemi_start
254821515XXXsemi_start
254821594XXXsemi_start
254821647XXXsemi_start
254821469GOODsemi_start
254821496GOODsemi_start
254821556GOODsemi_start
;;;;

data want;
  set have;
  by testnumber result notsorted;
  length eg_result2 $10;
  retain eg_result2;
  if first.testnumber then eg_result2='start';
  else if first.result then eg_result2='semi_start';
run;

proc print data=want noobs;
run;

Capture.JPG 

View solution in original post

4 REPLIES 4
Patrick
Opal | Level 21

Yes, it is possible.

 

Please provide more detail like sample data (not just a screenshot) and desired result. Below some guidelines how to ask a question which helps us to help you.

https://communities.sas.com/t5/Getting-Started/How-to-get-fast-helpful-answers/ta-p/226133 

HansSteenhuis
Calcite | Level 5

Thanks for your comment. I have added an excel file.

HansSteenhuis
Calcite | Level 5

I have just added a sas table as an example 🙂

 

Patrick
Opal | Level 21

@HansSteenhuis 

Just a SAS datastep creating the data is easiest for "us". I'm using SAS on a remote server and though would have to upload any SAS file prior to using it. 

Below Have table created via the EG import wizard.

DATA have;
    LENGTH
        TESTNUMBER         8
        DATE               8
        RESULT           $ 4
        EG_RESULT        $ 10 ;
    FORMAT
        TESTNUMBER       BEST12.
        DATE             DATE9.
        RESULT           $CHAR4.
        EG_RESULT        $CHAR10. ;
    INFORMAT
        TESTNUMBER       BEST12.
        DATE             DATE9.
        RESULT           $CHAR4.
        EG_RESULT        $CHAR10. ;
    INFILE DATALINES4
        DLM='7F'x
        MISSOVER
        DSD ;
    INPUT
        TESTNUMBER       : BEST32.
        DATE             : BEST32.
        RESULT           : $CHAR4.
        EG_RESULT        : $CHAR10. ;
DATALINES4;
112520870GOODstart
112520909GOODstart
112520940GOODstart
112521027GOODstart
112521109GOODstart
112521250GOODstart
112521361GOODstart
112521465GOODstart
112521549GOODstart
112521654GOODstart
112521703GOODstart
254820979GOODstart
254821026GOODstart
254821066GOODstart
254821158GOODstart
254821448XXXsemi_start
254821466XXXsemi_start
254821515XXXsemi_start
254821594XXXsemi_start
254821647XXXsemi_start
254821469GOODsemi_start
254821496GOODsemi_start
254821556GOODsemi_start
;;;;

data want;
  set have;
  by testnumber result notsorted;
  length eg_result2 $10;
  retain eg_result2;
  if first.testnumber then eg_result2='start';
  else if first.result then eg_result2='semi_start';
run;

proc print data=want noobs;
run;

Capture.JPG 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 537 views
  • 0 likes
  • 2 in conversation