Recommended naming conventions

<< Click to Display Table of Contents >>

Navigation:  Reference > Pre-processor >

Recommended naming conventions

We recommend using the first two characters of any index name to identify any special use it may have. For the following uses we recommend:

ds Data Set index name.

df ODBC File index name.

dl ODBC Loop index name.

lp Loop index name.

sn Subroutine name

sp Subroutine parameter

Otherwise use Capitalised words for index names as follows:

[*sbdef snRepeated=REPspFirstParam]

First parameter is [REPspFirstParam]

[*sbend snRepeated]

[*data dsSpecials=Jim,John,Fred]

[*dbopen dfMyFile=’My Database.xls’]

[*dbloop dlThisTime=dfMyFile;’My Sheet’]

[*set ListAge=[dlThisTime.’Age’]]

[*set ListName=’[dlThisTime.’Name’]’]

[ListName] is [Age] years old

[*do lpSpecials=1:[dsSpecials.#]]

[*block 99 string ListName.eq.[dsSpecials.lpSpecial]]

Special agent

[*99]

[*end lpSpecials]

[*sbcall snRepeated=Age]

[*dbEnd dlThisTime]

[*dbClose dfMyFile]

These recommendations are used in examples in the rest of this document.

Names in *INSERT files

All index names within a reusable insert file should begin with the name of the insert file (or a shortened version of it). This name should be all Capital letters, for example:

! This is an insert file called "do stats table": DOST

[*data DOSTdsList = one,two,three,four,five]

[*do DOSTlpLoop=1:5]

[DOSTdsList.DOSTlpLoop]

[*end DOSTlpLoop]

Names in *SBDEF subroutines

All index names within a subroutine should begin with the name of the subroutine (or a shortened version of it). This name should be all Capital letters, for example:

[*sbdef snOutput=OUTspTitle,OUTspName]

Name is [OUTspTitle] [OUTspName]

[*set OUTTemp=0]

[*sbend snOutput]

Names: files, ODBC tables and columns

Any file or ODBC names can be enclosed in ’r; (single quotes) to preserve blanks. It is good practice to enclose all such names in quotes for readability.

All such names are not sensitive to case so

[*dbopen dfMine =’my workbook.xls’]]

[*dbloop dlLoopRow = dfMine;’my worksheet’;’name’,’address’]

can be used to refer to "My Workbook.xls" sheet "My WorkSheet" columns headed "NAME" and "ADDRESS".