BookmarkSubscribeRSS Feed
LuisValença
Calcite | Level 5

I have a transformation inside a job, in DIS, which uses a table to create a new table with a new field which is the concatenation of two fields from the source table.

 

Example:

 

Source table:

....

Postal Code (Postal_Code)     2775-001

Postal Code Name  (Postal_Code_Name)   PAREDE

 

Target:

.....

Postal Code (Postal_Code)     2775-001

Postal Code Name  (Postal_Code_Name)   PAREDE

Postal Code Description (Postal_Code_Desc)   2775-001 PAREDE (New field)

 

How extract, from metadata, this relationship?

 

I intended to get the following relationships for fields

Src (Postal_Code) -> Tgt (Postal_code)

Src(Postal_Code_Name) -> Tgt(Postal_Code_Name)

Src (Postal_Code) -> Tgt (Postal_Code_Desc)

Src (Postal_Code_Name) -> Tgt (Postal_Code_Desc)

 

where Src means Source and Tgt menas Target.

1 REPLY 1
Patrick
Opal | Level 21

@LuisValença

It's nothing I'd attempt doing as it's going to become quite involved.

 

The first thing you've got to figure out is where in Metadata this information is stored. Once you've got this you need to write the code to actually query metadata and pull out this information (SAS data step or Proc Metadata).

 

I've got two approaches to figure out where stuff lives in SAS Metadata.

 

A: Analyse XML

Export your job (.spk), then open this .spk with WinZip or the like, find the relevant XML and search for your expression. Then analyse the XML to figure out the Tag hierarchies as this will tell you how to query metadata.

 

B: Use Metabrowse

Use PC SAS and use METABROWSE

Capture.JPG

 

The dive into the trees to find your expression:

Capture.JPG

 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1007 views
  • 0 likes
  • 2 in conversation