Re: [EXTERNAL] Re: dfsort - Reformat file

2022-09-06 Thread Paul Gilmartin
On Tue, 6 Sep 2022 21:32:37 +, Pommier, Rex wrote:
>
> 
>So each control statement must either be labelled or a comment, since it's 
>impossible not to use column 1 with RECFM=F.
>
>
>No, because a bit earlier in the same manual, under the "general coding rules" 
>we find this:
>
>The control statements are free-form; that is, the operation definer, 
>operands, and comment field can appear anywhere in a statement, provided they 
>appear in the proper order and are separated by one or more blank characters. 
>Column 1 of each control statement must be blank, unless the first field is a 
>label or a comment statement (see Inserting comment statements).
>
I see that on page 80 of the current PDF under General coding rules.  But 
slightly later, on page 83,
under Coding restrictions:

• Column 1 of each control statement can be used only for a label or for a 
comment statement
  that begins with an asterisk in column 1.

That contradicts "Column 1 ... blank" on page 80.  A blank in column 1 is 
*used* to indicate
a control statement.

I disapprove of documentation by restriction; it's a misuse of the Totalitarian 
Principle:
.  It's better to specify 
valid syntax
and presume all else is restricted.

• Operation definers and operands must be in uppercase EBCDIC.
Which EBCDIC?  1047? 500? 037?  Other (specify)?  It matters.

Under INCLUDE Control Statement
Hexadecimal string format
The format for coding a hexadecimal string constant is: X'yy...yy'
The value yy represents any pair of hexadecimal digits. You can specify up 
to
256 pairs of hexadecimal digits.

"up to 256".  I guess that's OK.  But it requires 4(?) continuation lines  This 
might
be a good place for an example of coding continuation.

Table 23. Valid and Invalid Hexadecimal Constants provides some valuable
illustrations, but it could be better.

And further:
Relational condition format
...
REH
Regular expressions with hexadecimal string

Is this he same Hexadecimal string format described above?  No mention
except in an example of the leading "\".  And that example shows:
OUTFIL OMIT=(25,032,SS,REH,C'(.*Z+)|(.*\XC2\XF1.*)')

Under INREC Control Statement, the definition d hexadecimal string
above is restated.  Is this the same as under the INCLUDE Control
Statement?  If so, it should appear just once, under General coding rules.
If different, the difference should be clearly emphasized.

Then, Table 37. Examples of Valid and Invalid Hexadecimal String Separation
Like table 23, but more extensive.  Is the earlier one necessary?  The word
"Separation" doesn't seem to fit.

This publication appears to have grown by accretion, without good editorial
control.

-- 
Thanks,
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: [EXTERNAL] Re: dfsort - Reformat file

2022-09-06 Thread Pommier, Rex
Gil, 

 
So each control statement must either be labelled or a comment, since it's 
impossible not to use column 1 with RECFM=F.


No, because a bit earlier in the same manual, under the "general coding rules" 
we find this:

The control statements are free-form; that is, the operation definer, operands, 
and comment field can appear anywhere in a statement, provided they appear in 
the proper order and are separated by one or more blank characters. Column 1 of 
each control statement must be blank, unless the first field is a label or a 
comment statement (see Inserting comment statements).

Rex

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Paul Gilmartin
Sent: Tuesday, September 6, 2022 3:44 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: [EXTERNAL] Re: dfsort - Reformat file

On Tue, 6 Sep 2022 12:03:44 -0700, Tom Brennan wrote:
>>
>> I just used a Special character to denote the start of a comment. You can 
>> have any character.
>
>And using # as that character shows we are being assimilated :)
> 
Kolusu was just trying to make me comfortable.


On Tue, 6 Sep 2022 19:02:41 +, Pommier, Rex wrote:
>
>I see in the very next section of this manual is something called "Coding 
>restrictions".  Apparently you don't even need a special character to delimit 
>a comment, errr, remark...I tagged "#" the relevant restrictions.  To 
>summarize, asterisk in column 1 is a comment, anything after a blank on any 
>other line is a remark.  
> 
I didn't read far enough.

>
>
>The following rules apply to control statement preparation:
>
>Operation definers and operands must be in uppercase EBCDIC.
>  #  Column 1 of each control statement can be used only for a label or for a 
> comment statement that begins with an asterisk in column 1.
>
So each control statement must either be labelled or a comment, since it's 
impossible not to use column 1 with RECFM=F.

I fins scant discussion of colons, such as:
• Continuation Column (72)
Any character other than a blank in this column indicates that the
present statement is continued on the next line. However, as long
as the last character of the operand field on a line is a comma or
semicolon or colon followed by a blank, the program assumes that
the next line is a continuation line. The nonblank character in column
72 is required only when a remark field is to be continued or when
an operand is broken at column 71.

And an example:
*1234567 
*23456789012345678901234567890123456789012345678901234567890123456789012
INCLUDE COND=(5,4,CH,EQ,
 C'ABCD')
SORT FIELDS=(9,
 3,
ZD,
 A)
OUTREC FIELDS=(1,27,2X,
FIRST FIELD AND TWO BLANKS
51,2,BI,M11,
60:9,3,ZD,PD)  THIRD FIELD

(Garbled by Copy/Paste.)  I suspect colon has to do with field specification, 
but I can find no unified definition of fields.

--
Thanks,
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
The information contained in this message is confidential, protected from 
disclosure and may be legally privileged. If the reader of this message is not 
the intended recipient or an employee or agent responsible for delivering this 
message to the intended recipient, you are hereby notified that any disclosure, 
distribution, copying, or any action taken or action omitted in reliance on it, 
is strictly prohibited and may be unlawful. If you have received this 
communication in error, please notify us immediately by replying to this 
message and destroy the material in its entirety, whether in electronic or hard 
copy format. Thank you.


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: [EXTERNAL] Re: dfsort - Reformat file

2022-09-06 Thread Pommier, Rex
Gil,

I see in the very next section of this manual is something called "Coding 
restrictions".  Apparently you don't even need a special character to delimit a 
comment, errr, remark...I tagged "#" the relevant restrictions.  To 
summarize, asterisk in column 1 is a comment, anything after a blank on any 
other line is a remark.  



The following rules apply to control statement preparation:

Operation definers and operands must be in uppercase EBCDIC.
  #  Column 1 of each control statement can be used only for a label or for a 
comment statement that begins with an asterisk in column 1.
If present, a label must begin in column 1. Labels are allowed only in the 
SYSIN and SORTCNTL data sets.
The entire operation definer must be contained on the first line of a 
control statement.
#The first operand must begin on the first line of a control statement. The 
last operand in a statement must be followed by at least one blank.
#   Blanks are not allowed in operands. Anything following a blank is 
considered part of the remark field.
Remarks are allowed only in the DFSPARM, SYSIN, and SORTCNTL data sets.
Commas, semicolons, and blanks can be used only as delimiters. They can be 
used in values only if the values are constants.
Each type of program control statement can appear only once within a single 
source (for example, the SYSIN data set).



Rex

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of Sri 
h Kolusu
Sent: Tuesday, September 6, 2022 11:20 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: [EXTERNAL] Re: dfsort - Reformat file

>> BTW, what's the syntax for comments in DFSORT command files?

Gil,

It is documented here

https://urldefense.com/v3/__https://www.ibm.com/docs/en/zos/2.5.0?topic=rules-inserting-comment-statements__;!!KjMRP1Ixj6eLE0Fj!tWOdD72_vf-mSDlcMyy6-nZqOfhAo-JfpwI7KBTfkM_IvYfCRMOwpCPxwxfhhC0MaK2yKwbTBOmAucYFHvM$
  

>> The solution above, lacking comments and with 8 numeric positional 
>> parameters is horribly opaque to the novice.

If there is NO reformatting(Binary/packed fields to Display fields, printing 
Hex numbers ), You just need POSITION of the data and LENGTH of the data to 
be written out.

//SYSINDD *
  OPTION COPY
* This is a sample comment with asterisks in position 1

  INREC BUILD=(05,08,# copy from pos 05 for a length of 08
   15,05,# copy from pos 15 for a length of 05
   22,21,# copy from pos 22 for a length of 21
   45,05)# copy from pos 45 for a length of 05
/*


Thanks,
Kolusu
DFSORT Development
IBM Corporation


--
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
The information contained in this message is confidential, protected from 
disclosure and may be legally privileged. If the reader of this message is not 
the intended recipient or an employee or agent responsible for delivering this 
message to the intended recipient, you are hereby notified that any disclosure, 
distribution, copying, or any action taken or action omitted in reliance on it, 
is strictly prohibited and may be unlawful. If you have received this 
communication in error, please notify us immediately by replying to this 
message and destroy the material in its entirety, whether in electronic or hard 
copy format. Thank you.


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN