BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8

COLLATE (start-position<,end-position> ) | (start-position<,,length> )

 

I find these syntax hard to understand . I dont get the < > symbols.

why start-position<

and why end-position>

why length>

what is going on

 

this applies to every command definition..not just collate

5 REPLIES 5
PeterClemmensen
Tourmaline | Level 20

It means that the arguements in <> are optional and not required. You can see this below the Syntax Definition in the Optional Arguments Section.

 

PeterClemmensen_0-1676535875876.png

 

HeatherNewton
Quartz | Level 8

but the come is confusing, why<,end-position>, seems < > not referring to the same term

what is <,,xxx>

 

why the comma not outside the brackets < >

SASKiwi
PROC Star

@HeatherNewton wrote:

but the come is confusing, why<,end-position>, seems < > not referring to the same term

what is <,,xxx>

 

why the comma not outside the brackets < >


Because if you don't specify that parameter you also don't include the comma. Including the comma without the parameter results in a syntax error.

Tom
Super User Tom
Super User

Do you not see the difference between these two forms?

collate(1,5)
collate(1,,5)

The first one has TWO arguments and the second one has THREE arguments, but the second argument is empty.

Tom
Super User Tom
Super User

Why not read the documentation on how to read the documentation?  Here is one from the SAS GRAPH manual but I suspect this description is in all of the manuals.  https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatgraph/p06hgx459w75qen1wpavfghx4ket.h...

 

Just expand it to multiple lines if you are having trouble understanding the compressed syntax.

COLLATE (start-position)

COLLATE (start-position,end-position )

COLLATE (start-position)

COLLATE (start-position,,length)

Not sure why they listed that one version with only one argument supplied twice. 

Might have been simpler to use something like:

COLLATE (start-position<,end-position> ) | (start-position,,length )

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 639 views
  • 6 likes
  • 4 in conversation