BookmarkSubscribeRSS Feed
ASHISH2525
Quartz | Level 8

Hi all,

 

I have attached input excel data file & desired output as well.

 

i have an id 'plan package' for multiple events (Event column )and datetype flag as 'Sch' and 'Act'. if an id has two records as 'Act' & 'Sch' then it should be considered as complete records & no need to have it in output.

 

outcome which i want is if 'Act' is not available & only 'Sch' is available for a record then on the basis of its 'Plan package' & Event its 'Date' should be replaced accordingly previous 'Act' flag record.

 

Let me know if any other details are required.

 

 

Regard,

Ashish

 

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

Can you post a small part example data in the form of a data step instead? Makes it so much easier to help you.

ASHISH2525
Quartz | Level 8
DATA WORK.INPUT0001;
LENGTH
PlanPackage $ 6
Discipline $ 10
Dates 8
Events $ 11
DateType $ 3 ;
FORMAT
PlanPackage $CHAR6.
Discipline $CHAR10.
Dates DATE9.
Events $CHAR11.
DateType $CHAR3. ;
INFORMAT
PlanPackage $CHAR6.
Discipline $CHAR10.
Dates DATE9.
Events $CHAR11.
DateType $CHAR3. ;
INFILE DATALINES4
DLM='7F'x
MISSOVER
DSD ;
INPUT
PlanPackage : $CHAR6.
Discipline : $CHAR10.
Dates : BEST32.
Events : $CHAR11.
DateType : $CHAR3. ;
DATALINES4;
007EUCElectrical20691Stage oneSch
007EUCElectrical20620Stage oneAch
007EUCElectrical20730Stage twoSch
007EUCElectrical20670Stage threeSch
007EUCElectrical20670Stage threeAch
007EUCElectrical20670Stage fourSch
007EUCElectrical20620Stage fiveSch
007EUCElectrical20573Stage fiveAch
007ZAElectrical20606Stage oneSch
007ZAElectrical20657Stage twoSch
007ZAElectrical20529Stage twoAch
;;;;

Capture.PNG

 

 

Output snap has been attached with Data steps.

 

andreas_lds
Jade | Level 19

Please post the data you have and what you want as text, i won't open excel-files. See How to convert datasets to data steps for details.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 562 views
  • 0 likes
  • 3 in conversation