• Subject: Re: Free format question on D specs
  • From: Barbara Morris <bmorris@xxxxxxxxxx>
  • Date: Thu, 31 Jan 2019 17:26:54 -0500
  • Arc-authentication-results: i=1; mx.google.com; spf=neutral (google.com: is neither permitted nor denied by best guess record for domain of rpg400@xxxxxxxxxxx) smtp.mailfrom=rpg400@xxxxxxxxxxx; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:in-reply-to:user-agent:content-transfer-encoding :mime-version:reply-to:references:message-id:organization:date :subject:from:to; bh=g/wjZK6I9vM6wOMmIwkzHOG/QzKQd+hWNRpdcmxhUas=; b=zzZ+LM01LTsQmJAfWXSnkz85QxdTA7x7/9VCykGUp/NR3/aVfxIB8zVYPttWUWaPCR IZp+BxHm5XYAeUYD+K4IdYPm8KNQM6d7lzbtYGi5+5NoF/c1iHl1Lykb8hRq0gwahCHW 8/oH7PXAoqtEJOxKIBFhbOC/0Zzwww8xdknVsy9nZ/lXbzGqP9V+P7I+pUj1YO1nEPPH Jw1abNhm5TVhXONpNdQ3f4f9eMUAhBLBs/53+jAvcj9Ew2FqdzGpsNKAUT1oDGtTvsGT 36iPv6zCtjuxwHlJxu5hP8ieJJdtqFbhf9PxApvFYBnNltffhCE2WSqCVgaUCmni9UA1 66rA==
  • Arc-seal: i=1; a=rsa-sha256; t=1548973627; cv=none; d=google.com; s=arc-20160816; b=i/+cMA11qlOJf/BZy7yb78qdVvTy42bXYvQ1gIiam7zNp+WpVnLBgV0zGKcKx73R4t gAbWl+irWMvKhpLTdVqEXinlGdZuZroUjLROVBPCToXC2L9W4pJSrxBar0PAJCnBzTJT pWv9JcOgrb1fhAU2gk9vKxLtkr6DwN50ZXFQMitcYS+qANa9up6jr613lZukk/hutJHt amaR54ANWgYhmk2WVkMvTHVgS5V29mteJ1+ySYFGAKjtA8tII+e/lvhK2DMP530SaNUK NeZ9FkFBtl3UlYIQJaY0Q+tOHzvuICJFOb+40xoOctpW4fSxj6PQzPGY9uRiBXbJHn2d 2Guw==
  • List-archive: <https://archive.midrange.com/rpg400-l/>
  • List-help: <mailto:rpg400-l-request@lists.midrange.com?subject=help>
  • List-id: "RPG programming on the IBM i \(AS/400 and iSeries\)" <rpg400-l.lists.midrange.com>
  • List-post: <mailto:rpg400-l@lists.midrange.com>
  • List-subscribe: <https://lists.midrange.com/mailman/listinfo/rpg400-l>, <mailto:rpg400-l-request@lists.midrange.com?subject=subscribe>
  • List-unsubscribe: <https://lists.midrange.com/mailman/options/rpg400-l>, <mailto:rpg400-l-request@lists.midrange.com?subject=unsubscribe>

On 2019-01-31 2:17 PM, Greg Wilburn wrote:
Not to hijack this thread... but I often wondered why the "order" of some things matter on free form d-specs.


// This is not valid
dcl-ds myDS qualified extname('ExtFile');
RNF3529E Keyword is not allowed for a program-described data structure; keyword is ignored.
(extname is highlighted)

// This IS valid
dcl-ds myDS extname('ExtFile') qualified;

I guess it's "not so free form" free form? :)

True :-)

There are a few cases where a keyword has to be first if it's specified, all basically for the same reason.

The compiler code for scanning free-form definitions is almost all the same as for fixed-form code, and there are a few things available in fixed form columns that the compiler needs so it knows which direction to take. For example, the data type keywords (CHAR, DATE) etc have to be first because fixed form has a data-type columm. For files, the device keyword (DISK, PRINTER) has to be first because fixed form has a device column. And for externally-described data structures, the EXT or EXTNAME keyword has to be first, because fixed form has the 'E' before the 'DS'. The compiler takes completely different paths for externally-described vs program-described data structures, so it needs to know right away what it's dealing with.

If you want to put EXTNAME later (or if don't want to code it at all), you could code EXT as the first keyword and code the EXTNAME keyword later (or not at all).

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].