text: d myDate s d inz(d'2011-05-17')There are two things of note here. First, to set the value of a date field with a literal, it must be preceded by the letter d and wrapped in single quotation marks ('). This is also true for comparing date values in conditional statements:
  if myDate = d'2011-05-17' ; // code endif ;The format used to initialize the date is *ISO: the default DATFMT (date format) for date literals is *ISO. To initialize dates in a different format you must specify the compiler instruction in H-spec.
  h DATFMT(*USA)Now all the date fields in your program require literals to be in the *USA format. Whatever format you use, you must be consistent throughout your program.'2011-05-17') d myDateUSA s d datfmt(*USA) inz(d'2010-03-23') d myDateString s 10a /free myDateUSA = myDateISO ; dsply myDateUSA ; *inlr = *on ; /end-freeSource: ITjungle by Joel Cochran, 
  NO JUNK, Please try to keep this clean and related to the topic at hand.
  Comments are for users to ask questions, collaborate or improve on existing.