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

Hi All,

i want to combine below mentioned three individual extract transformations into single node instead of 3 different ones in SAS DI job. please suggest.

Extract -1

proc sql;
   create table work.RRRR as
      select
	  PTPTPTPT,
	  PSPSPSPSPS,
	  SSSSSSS,
	  DDDDDD
         from &SYSLAST
      where STRIP(UPCASE(PTPTPTPT))  IN ('XXXXX',' ') & STRIP(UPCASE(PSPSPSPSPS))='YYYY'  & 
         STRIP(UPCASE(SSSSSSS))  IN ('DDD','EEE') &  DDDDDD >= "&GGGG" D
   ;
quit;

Extract 2 :

using Extract 1 work output is further splitted into Extract 2 and Extract 3 transformations

Extract 2:

proc sql;
   create table work.RTRTTTRR as
      select
         *
   from &SYSLAST
      where SSSSSSS='EEE'
   ;
quit;

Extract 3 :

proc sql;
   create table work.W5XXE8Q6 as
      select *
          from &SYSLAST
      where SSSSSSS= 'DDD'  &  DDDDDD >= "&DDDTR"D
   ;
quit;

JJP1_0-1591551255506.png

Current scenario is above and i am expecting single extract transformation instead of 3 nodes please.

(Note : i don't want to use uwc code transformation please. i want to make use of only SAS DI transformations if possible with extract)

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

Then combine your three where clauses into one like below. 

proc sql;
   create table work.RRRR as
      select
        PTPTPTPT,
        PSPSPSPSPS,
        SSSSSSS,
        DDDDDD
      from &SYSLAST
      where 
        STRIP(UPCASE(PTPTPTPT))  IN ('XXXXX',' ') 
        and STRIP(UPCASE(PSPSPSPSPS))='YYYY' 
        and DDDDDD >= "&GGGG" D
        and
         (
         SSSSSSS='EEE'
         OR
         SSSSSSS= 'DDD'  &  DDDDDD >= "&DDDTR"D
         )
   ;
quit;

View solution in original post

9 REPLIES 9
Patrick
Opal | Level 21

Then combine your three where clauses into one like below. 

proc sql;
   create table work.RRRR as
      select
        PTPTPTPT,
        PSPSPSPSPS,
        SSSSSSS,
        DDDDDD
      from &SYSLAST
      where 
        STRIP(UPCASE(PTPTPTPT))  IN ('XXXXX',' ') 
        and STRIP(UPCASE(PSPSPSPSPS))='YYYY' 
        and DDDDDD >= "&GGGG" D
        and
         (
         SSSSSSS='EEE'
         OR
         SSSSSSS= 'DDD'  &  DDDDDD >= "&DDDTR"D
         )
   ;
quit;
JJP1
Pyrite | Level 9

Thank @Patrick . I will work on it and get back on this please. thank you.

JJP1
Pyrite | Level 9

Hi @Patrick ,

Current scenario after 3extract transformations i was using apend and then table loader(replace) to load into final table. i was just trying to validate the count of records with 3 extracts and append and then the one you suggested into single extract node. but the count is not matching i extract node is having less records compared to 3 extract node logic. please suggest. i thought that it should exactly match with both ways. do you feel any thing wrong with this please. 

JJP1_0-1591615277324.png

 

Patrick
Opal | Level 21

I would expect the same row counts as well. 

Not sure if the append transformation always re-creates the target table so make sure you execute this in a new session before counting the rows (or check in the generated log that the target table gets always deleted first).

 

Eventually post the actually generated code (as attachments) from both DIS job versions.

JJP1
Pyrite | Level 9

append transformation is making use of set statement in code and the target table is already in deleted state only.

Actualy iam checking by running on the work tables in SAS DI.but it is not exactly matching please.

new session only iam executing the job please

Patrick
Opal | Level 21

Post the relevant code sections of both job versions please.

JJP1
Pyrite | Level 9

yes @Patrick .i am currently running the job which has larger no of  records . thanks patrick.

JJP1
Pyrite | Level 9

Hi @Patrick .no change evern after trying that second option same record count coming as previous one please

JJP1
Pyrite | Level 9

Thanks @Patrick .

solution provided by you working as expected and exactly matching with final target table record count.

thank you . 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 9 replies
  • 1574 views
  • 1 like
  • 2 in conversation