Re: dfsort - Reformat file

2022-09-07 Thread Paul Gilmartin
On Wed, 7 Sep 2022 16:24:07 +, Sri h Kolusu wrote:

>>> That contradicts "Column 1 ... blank" on page 80.  A blank in column 1 is 
>>> *used* to indicate a control statement.
>
>Gil,
>
>Not sure as to what is contradictory.
>
>Statement 1 : "Column 1 of each control statement must be blank, unless the 
>first field is a label or a comment statement (see Inserting comment 
>statements)."
>Statement 2 : " 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.”
> 
The word "only" makes it contradictory.  Column 1 is *used* for the blank 
indicating that
the statement is neither a comment nor labelled.

>So Blank for Control statement and asterisks for Label or comment field.
>
>>> • Operation definers and operands must be in uppercase EBCDIC. Which 
>>> EBCDIC?  1047? 500? 037?  Other (specify)?  It matters.
>
>If you looked at the Appendix D you would have found “EBCDIC and ASCII 
>collating sequences”
>
>https://www.ibm.com/docs/en/zos/2.4.0?topic=sequences-ebcdic
> 
The EBCDIC is incomplete.  It shows only 91 (my count), less than half the
256 possibilities.  Conspicuously, it omits [, ], {, and }; integral to DFSORT.
Those characters occur at different code points in the popular 037, 500,
and 1047 code pages.  I mentioned this concern in an RCF several days
ago.

The ASCII is better; apparently complete.

It's disturbing that the ATOE and ETOA tables are not inverses of each other.
Those are called the TCP/IP "standard".  Internet standards are admnistered
by the IETF and bear RFC numbers.  I see no RFC number.  I suspect those
tables are something IBM just made up and pretends they are a standard.

>>> Is this the same Hexadecimal string format described above?  No mention 
>>> except in an example of the leading "\".  And that example shows:
>
>The Hexadecimal string definition is SAME across the operators 
>(INCLUDE/OMIT/INREC/OUTREC…). The leading “\” is used to denote the 
>Hexadecimal string.
>
It doesn't appear the same; INCLUDE/OMIT/INREC/OUTREC… lack the "\" but
have apostrophes not shown in the regular expression example.  And I consider
it bad practice not to define syntax of a construct but merely to show a single 
example.

>>> 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.

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


Re: dfsort - Reformat file

2022-09-07 Thread Sri h Kolusu
>> That contradicts "Column 1 ... blank" on page 80.  A blank in column 1 is 
>> *used* to indicate a control statement.

Gil,

Not sure as to what is contradictory.

Statement 1 : "Column 1 of each control statement must be blank, unless the 
first field is a label or a comment statement (see Inserting comment 
statements)."
Statement 2 : " 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 Blank for Control statement and asterisks for Label or comment field.

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

If you looked at the Appendix D you would have found “EBCDIC and ASCII 
collating sequences”

https://www.ibm.com/docs/en/zos/2.4.0?topic=sequences-ebcdic

>>"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.

We just cannot add all the different permuations and combination of examples.   
You want an example for INCLUDE and some one else might OMIT and different 
relational operator (EQ , NE, GE,GT, LE, LT).  So it is difficult to document 
every example and as is the DFSORT application programming guide is already 900 
pages long.

>> Is this the same Hexadecimal string format described above?  No mention 
>> except in an example of the leading "\".  And that example shows:

The Hexadecimal string definition is SAME across the operators 
(INCLUDE/OMIT/INREC/OUTREC…). The leading “\” is used to denote the Hexadecimal 
string.

>> 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.

The different tables are shown depending on which repeating factor you are using

20X  = 20X’40’ = 20 spaces
20Z = 20 X’00’ = 20 binary zeros
20X’F1F2F3F4’  = 20 strings of 1234
…

So we are just showing valid/invalid combinations


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

To be honest, I feel that you are just nit picking.  You have made it 
abduntantly clear over the years that you are NOT a big user of DFSORT and you 
would use a different tool to get your work done, but yet you have a comment 
for almost every section of our documentation.  I guess it is tough to please 
you as on one hand you say it is excessive and other you say it is inadequate.


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


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: dfsort - Reformat file

2022-09-06 Thread Sri h Kolusu
>> (Garbled by Copy/Paste.)

Gil,

Did you try enclosing the control cards using "Courier New" font ? It retains 
the spacing.

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

Not sure what you meant by IMPOSSIBLE . You don’t have to always use column 1. 
You can leave blank lines in between control cards and DFSORT will simply 
ignore them and scan for the next available keyword.  Here is an example.

//SYSINDD *
  OPTION COPY





  SORT FIELDS=(1,3,CH,A)


  OUTREC OVERLAY=(35:C'Ibm-Main')

/*


>>.)  I suspect colon has to do with field specification,

Not exactly.  Colon Specifies the position (column) for a separation field, 
input field, decimal constant, arithmetic expression, or sequence number, 
relative to the start of the reformatted input record. Unused
space preceding the specified column is padded with EBCDIC blanks. The 
following rules apply:
  • c must be a number between 1 and 32752.
  • c: must be followed by a separation field, input field, decimal 
constant, or arithmetic expression.
  • c must not overlap the previous input field or separation field in the 
reformatted input record.
  • for variable-length records, c: must not be specified before the first 
input field (the record
  descriptor word) nor after the variable part of the input record.
  • The colon (:) is treated like the comma (,) or semicolon (;) for 
continuation to another line.



≫but I can find no unified definition of fields.

Had you searched the application programming guide for P,M  or FIELDS= or 
BUILD=  , you would have found a detail description of how the reformatted 
INREC/OUTREC consists of

Example 
https://www.ibm.com/docs/en/zos/2.5.0?topic=statements-inrec-control-statement

Scroll down to the section of P,M,a and you will find detailed description.


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


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: dfsort - Reformat file

2022-09-06 Thread Paul Gilmartin
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


Re: dfsort - Reformat file

2022-09-06 Thread Tom Brennan

On 9/6/2022 10:19 AM, Sri h Kolusu 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 :)

--
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


Re: dfsort - Reformat file

2022-09-06 Thread Paul Gilmartin
On Tue, 6 Sep 2022 17:19:22 +, Sri h Kolusu wrote:
>
>I just used a Special character to denote the start of a comment. You can have 
>any character.
>
Are those "comments", which the Guide says must start with an asterisk
in column 1, or "remarks" a term which the Guide uses repeatedly, but
never defines.

>> I suspect the convention would be comfortable, even intuitive, to the 
>> experienced HLASM or JCL programmer, but would require explanation to a 
>> programmer with a different background.  The Guide should be more explicit 
>> about general syntactic conventions.

>The Guide would benefit from greater use of comments and remarks in its 
>Examples, both to:
>o make the operation clearer to the reader, and to make the programmer 
>familiar with use of comments.
>
>With limit of 80 bytes it is difficult to have detailed comments as a part of 
>SYSIN control cards.
>
JES3 and later JES2 have removed the 80 byte limit many years ago.  DFSORT
would benefit from taking advantage of this.

> ... The application programming guide explains in detail about the control 
> cards below. 
>Check these links.
>
>https://www.ibm.com/docs/es/zos/2.5.0?topic=iriodse-example-1
>
Where I see:
INCLUDE  COND=(5,8,GT,13,8,|,105,4,LE,1000),FORMAT=CSF

This could be clarified with remarks(?) such as:
INCLUDE  COND=(
5,8,  #  The number in bytes 5 through 12
GT,   #  is greater than
13,8, #  the number in bytes 13 through 20
|,  # or:
105,4,  # The number in bytes 105 through 108
LE,1000   # is less than or equal to 1000
),FORMAT=CSF # Indicates all numbers are floating sign.

All comfortably within 80 bytes.

OK.  Far too many remarks.  But when instructing a novice it's better to
err on the side of too much information than of none at all.

>https://www.ibm.com/docs/en/zos/2.5.0?topic=rrape-example-1

-- 
Thanks,
gil

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


Re: dfsort - Reformat file

2022-09-06 Thread Sri h Kolusu
>> What are the "# ..." constructs?  I see "remarks" mentioned in the Guide, 
>> but no description of the syntax of remarks (did I miss one?)

I just used a Special character to denote the start of a comment. You can have 
any character.

> I suspect the convention would be comfortable, even intuitive, to the 
> experienced HLASM or JCL programmer, but would require explanation to a 
> programmer with a different background.  The Guide should be more explicit 
> about general syntactic conventions.
The Guide would benefit from greater use of comments and remarks in its 
Examples, both to:
o make the operation clearer to the reader, and to make the programmer familiar 
with use of comments.

With limit of 80 bytes it is difficult to have detailed comments as a part of 
SYSIN control cards.  The application programming guide explains in detail 
about the control cards below. 
Check these links.

https://www.ibm.com/docs/es/zos/2.5.0?topic=iriodse-example-1

https://www.ibm.com/docs/en/zos/2.5.0?topic=rrape-example-1


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


Re: dfsort - Reformat file

2022-09-06 Thread Paul Gilmartin
On Tue, 6 Sep 2022 16:19:30 +, Sri h Kolusu wrote:
>
>It is documented here
>
>https://www.ibm.com/docs/en/zos/2.5.0?topic=rules-inserting-comment-statements
>
>>> The solution above, lacking comments and with 8 numeric positional 
>>> parameters is horribly opaque to the novice.
>
>If there is NO reformatting(Binary/cacked 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 for the examples.  I fear I relied too much on Examples in the
Regunar Expressions section, which lack comments, rather than
RTFM.

What are the "# ..." constructs?  I see "remarks" mentioned in the Guide,
but no description of the syntax of remarks (did I miss one?)

I suspect the convention would be comfortable, even intuitive, to the
experienced HLASM or JCL programmer, but would require explanation to
a programmer with a different background.  The Guide should be more
explicit about general syntactic conventions.

The Guide would benefit from greater use of comments and remarks in its
Examples, both to:
o make the operation clearer to the reader, and to
o make the programmer familiar with use of comments.

-- 
Thanks,
gil

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


Re: dfsort - Reformat file

2022-09-06 Thread Sri h Kolusu
>> BTW, what's the syntax for comments in DFSORT command files?

Gil,

It is documented here

https://www.ibm.com/docs/en/zos/2.5.0?topic=rules-inserting-comment-statements

>> 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


Re: dfsort - Reformat file

2022-09-06 Thread Paul Gilmartin
On Mon, 5 Sep 2022 16:25:20 -0700, Retired Mainframer wrote:

>"It didn't work" doesn't tell us very much.  How did the results differ from
>what you wanted?
>
>Is it always four blanks in field 1, two in field 2, two in field 3, and 2 in
>field 4?  Is the length of each field constant across all the records?  If so,
>then does
>BUILD=(5,8,15,5,22,21,45,5)
>come close to what you want?
> 
Here's an alternative sample using "sed"; independent of number of fields
or number of leading spaces:
#! /bin/sh -x

echo "\
ll1652087|  0049|  OPTICAL |  0170|
ll2130994|  0006|  STATIONERY  |  0716|
ll2199447|  0078|  SERVE OVER PIZZA|  0410|
ll2199449|  0078|  SERVE OVER PIZZA|  0410|" |

sed '
# Special treatment for first field -- remove length
s/^.. *//
# Remaining fields 
s/| */|/g'

It's not what the oP asked for, but Mr. Natural says, Use the right tool for 
the job.

BTW, what's the syntax for comments in DFSORT command files?  The solution
above, lacking comments and with 8 numeric positional parameters is horribly
opaque to the novice.


>-Original Message-
>From: Ron Thomas
>Sent: Monday, September 5, 2022 10:31 AM
>
>We have a input PIPE DELIMITED file as follows of lrecl = 80. Need to remove
>the leading spaces with out disturbing the 3 column values
>
>1652087|..0049|..OPTICAL |..0170|
>2130994|..0006|..STATIONERY  |..0716|
>2199447|..0078|..SERVE OVER PIZZA|..0410|
>2199449|..0078|..SERVE OVER PIZZA|..0410|
>
>o/p has to be
>
>1652087|0049|OPTICAL |0170|
>2130994|0006|STATIONERY  |0716|
>2199447|0078|SERVE OVER PIZZA|0410|
>2199449|0078|SERVE OVER PIZZA|0410|

-- 
gil

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


Re: dfsort - Reformat file

2022-09-06 Thread Sri h Kolusu
>> i used OUTREC BUILD=(1,80,SQZ=(SHIFT=LEFT)) and it didn't work out
Could someone pls let me know how to make this ?

Ron,

To begin with the leading data in 3rd column is NOT spaces.  It seems that the 
data is Variable data where the first 2 bytes is a binary field that contains 
the length of the data.  So If you don't need the length part, then simply 
remove it using INREC or OUTREC as shown "retired mainframer"

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


Re: dfsort - Reformat file

2022-09-05 Thread Retired Mainframer
"It didn't work" doesn't tell us very much.  How did the results differ from 
what you wanted?

Is it always four blanks in field 1, two in field 2, two in field 3, and 2 in 
field 4?  Is the length of each field constant across all the records?  If so, 
then does
BUILD=(5,8,15,5,22,21,45,5)
come close to what you want?

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Ron Thomas
Sent: Monday, September 5, 2022 10:31 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: dfsort - Reformat file

Hi ,

We have a input PIPE DELIMITED file as follows of lrecl = 80. Need to remove 
the leading spaces with out disturbing the 3 column values

1652087|..0049|..OPTICAL |..0170|
2130994|..0006|..STATIONERY  |..0716|
2199447|..0078|..SERVE OVER PIZZA|..0410|
2199449|..0078|..SERVE OVER PIZZA|..0410|

o/p has to be

1652087|0049|OPTICAL |0170|
2130994|0006|STATIONERY  |0716|
2199447|0078|SERVE OVER PIZZA|0410|
2199449|0078|SERVE OVER PIZZA|0410|

i used OUTREC BUILD=(1,80,SQZ=(SHIFT=LEFT)) and it didn't work out

Could someone pls let me know how to make this ?

Thanks
Ron T

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