Character strings

The format for writing a character string is:
C'x...x'

where x is an EBCDIC character. For example, C'FERN'.

If you want to include a single apostrophe in the string, you must specify it as two single apostrophes. For example, O’NEILL must be specified as C'O''NEILL'.

You can use special keywords to specify a character string for the current date of the run in various forms, as detailed in z/OS DFSORT Application Programming Guide. For example, if you want to select records in which a 10-character date in the form C'yyyy/mm/dd' starting in position 42 equals today's date, write:
  INCLUDE COND=(42,10,CH,EQ,DATE1(/))
You can also use special keywords to specify a character string for a future or past date (relative to the current date of the run) in various forms, as detailed in z/OS DFSORT Application Programming Guide. For example, if you want to select records in which a 10-character date in the form C'yyyy/mm/dd' starting in position 42 is between 30 days in the past and 30 days in the future, write:
  INCLUDE COND=(42,10,CH,GE,DATE1(/)-30,AND,42,10,CH,LE,DATE1(/)+30)