Discussion:
Problem creating file of combined records with SORT
(too old to reply)
Bill Ashton
2017-12-29 16:06:23 UTC
Permalink
Hello! I am trying to use DFSORT to extract some records from a transaction
work file to be displayed in Microsoft Excel (and also on the mainframe).

The data contains a lot of hierarchical information (Customer, Region,
Location, and contact people), and I would like to create a single record
for each contact containing the whole hierarchy. I coded what I thought was
the correct SORT statements, but I still get a confusing error on my INREC
statement.

I even cut the input down to a single IfTHEN statement, and that still
flunked. I would appreciate Kolusu or someone else taking a look at this to
see what I have missed.

Here is my SYSIN (the INCLUDE works fine):
OPTION COPY,VLSCMP IT IS NOT REQUIRED, BUT USEFUL
*
INCLUDE COND=(1,04,CH,EQ,C'CM03',OR,
1,04,CH,EQ,C'CR02',OR,
1,04,CH,EQ,C'CL01',OR,
1,04,CH,EQ,C'CC02',OR,
1,14,CH,EQ,C'>CUST MASTER$,',OR,
1,10,CH,EQ,C'>CUST REG,',OR,
1,11,CH,EQ,C'>CUST LOC1,',OR,
1,12,CH,EQ,C'>CUST CONT$,')

INREC IFOUTLEN=245,
IFTHEN=(WHEN=(1,14,CH,EQ,C'>CUST MASTER$,'),
PARSE=(%01=(ABSPOS=15,ENDBEFR=C'(',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CM03'),
PARSE=(%02=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=5))),
IFTHEN=(WHEN=(1,10,CH,EQ,C'>CUST REG,'),
PARSE=(%03=(ABSPOS=11,ENDBEFR=C'(',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CR02'),
PARSE=(%04=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3))),
IFTHEN=(WHEN=(1,11,CH,EQ,C'>CUST LOC1,'),
PARSE=(%05=(ABSPOS=12,ENDBEFR=C' ',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CL01'),
PARSE=(%06=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3),
%07=(ABSPOS=10,ENDBEFR=C' ',FIXLEN=15))),
IFTHEN=(WHEN=(1,12,CH,EQ,C'>CUST CONT$,'),
PARSE=(%08=(ABSPOS=13,ENDBEFR=C' ',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CC02'),
PARSE=(%09=(ABSPOS=06,FIXLEN=3),
%10=(ABSPOS=10,FIXLEN=2),
%11=(ABSPOS=13,FIXLEN=1),
%12=(ABSPOS=15,FIXLEN=1),
%13=(ABSPOS=17,FIXLEN=5))),

BUILD=(%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'))
%02,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%03,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%04,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%05,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%06,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%07,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%08,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%09,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%11,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%12,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'))


I am trying to create two output sets, but since I did not get the first to
work, I did not even try the second. Hopefully someone can put me on the
right track.

I have attached a file with the data layout (it won't display right in HTML
with multiple embedded spaces).

Thanks for lending a hand here, and happy new year!
Billy
--
Thank you and best regards,
*Billy Ashton*

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Sri h Kolusu
2017-12-29 16:16:56 UTC
Permalink
Bill Ashton,

If you have data on multiple records and you need to combine them to a
single record, you need to use WHEN=GROUP to push the contents on to other
records and then write out a single record.

So if you can send the original input file on the mainframe, I can show
you a way to do it.

Thanks,
Kolusu
DFSORT Development
IBM Corporation
Date: 12/29/2017 09:08 AM
Subject: Problem creating file of combined records with SORT
Hello! I am trying to use DFSORT to extract some records from a transaction
work file to be displayed in Microsoft Excel (and also on the
mainframe).
The data contains a lot of hierarchical information (Customer, Region,
Location, and contact people), and I would like to create a single record
for each contact containing the whole hierarchy. I coded what I thought was
the correct SORT statements, but I still get a confusing error on my INREC
statement.
I even cut the input down to a single IfTHEN statement, and that still
flunked. I would appreciate Kolusu or someone else taking a look at this to
see what I have missed.
OPTION COPY,VLSCMP IT IS NOT REQUIRED, BUT USEFUL
*
INCLUDE COND=(1,04,CH,EQ,C'CM03',OR,
1,04,CH,EQ,C'CR02',OR,
1,04,CH,EQ,C'CL01',OR,
1,04,CH,EQ,C'CC02',OR,
1,14,CH,EQ,C'>CUST MASTER$,',OR,
1,10,CH,EQ,C'>CUST REG,',OR,
1,11,CH,EQ,C'>CUST LOC1,',OR,
1,12,CH,EQ,C'>CUST CONT$,')
INREC IFOUTLEN=245,
IFTHEN=(WHEN=(1,14,CH,EQ,C'>CUST MASTER$,'),
PARSE=(%01=(ABSPOS=15,ENDBEFR=C'(',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CM03'),
PARSE=(%02=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=5))),
IFTHEN=(WHEN=(1,10,CH,EQ,C'>CUST REG,'),
PARSE=(%03=(ABSPOS=11,ENDBEFR=C'(',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CR02'),
PARSE=(%04=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3))),
IFTHEN=(WHEN=(1,11,CH,EQ,C'>CUST LOC1,'),
PARSE=(%05=(ABSPOS=12,ENDBEFR=C' ',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CL01'),
PARSE=(%06=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3),
%07=(ABSPOS=10,ENDBEFR=C' ',FIXLEN=15))),
IFTHEN=(WHEN=(1,12,CH,EQ,C'>CUST CONT$,'),
PARSE=(%08=(ABSPOS=13,ENDBEFR=C' ',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CC02'),
PARSE=(%09=(ABSPOS=06,FIXLEN=3),
%10=(ABSPOS=10,FIXLEN=2),
%11=(ABSPOS=13,FIXLEN=1),
%12=(ABSPOS=15,FIXLEN=1),
%13=(ABSPOS=17,FIXLEN=5))),
BUILD=(%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'))
%02,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%03,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%04,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%05,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%06,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%07,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%08,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%09,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%11,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%12,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'))
I am trying to create two output sets, but since I did not get the first to
work, I did not even try the second. Hopefully someone can put me on the
right track.
I have attached a file with the data layout (it won't display right in HTML
with multiple embedded spaces).
Thanks for lending a hand here, and happy new year!
Billy
--
Thank you and best regards,
*Billy Ashton*
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
[attachment "SORT Trans Data.txt" deleted by Sri h Kolusu/Silicon
Valley/IBM]


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Bill Ashton
2017-12-29 16:18:42 UTC
Permalink
Here is the error when I only use one IFTHEN:

INREC IFOUTLEN=245,

IFTHEN=(WHEN=(1,14,CH,EQ,C'C'>CUST MASTER$,'),

PARSE=(%01=(ABSPOS=15,ENDBEFR=C'(',FIXLEN=50))),

$

ICE107A 6 DUPLICATE, CONFLICTING, OR MISSING INREC OR OUTREC STATEMENT
OPERANDS
BUILD=(%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'))

$

ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY

*
Post by Bill Ashton
Hello! I am trying to use DFSORT to extract some records from a
transaction work file to be displayed in Microsoft Excel (and also on the
mainframe).
The data contains a lot of hierarchical information (Customer, Region,
Location, and contact people), and I would like to create a single record
for each contact containing the whole hierarchy. I coded what I thought was
the correct SORT statements, but I still get a confusing error on my INREC
statement.
I even cut the input down to a single IfTHEN statement, and that still
flunked. I would appreciate Kolusu or someone else taking a look at this to
see what I have missed.
OPTION COPY,VLSCMP IT IS NOT REQUIRED, BUT USEFUL
*
INCLUDE COND=(1,04,CH,EQ,C'CM03',OR,
1,04,CH,EQ,C'CR02',OR,
1,04,CH,EQ,C'CL01',OR,
1,04,CH,EQ,C'CC02',OR,
1,14,CH,EQ,C'>CUST MASTER$,',OR,
1,10,CH,EQ,C'>CUST REG,',OR,
1,11,CH,EQ,C'>CUST LOC1,',OR,
1,12,CH,EQ,C'>CUST CONT$,')
INREC IFOUTLEN=245,
IFTHEN=(WHEN=(1,14,CH,EQ,C'>CUST MASTER$,'),
PARSE=(%01=(ABSPOS=15,ENDBEFR=C'(',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CM03'),
PARSE=(%02=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=5))),
IFTHEN=(WHEN=(1,10,CH,EQ,C'>CUST REG,'),
PARSE=(%03=(ABSPOS=11,ENDBEFR=C'(',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CR02'),
PARSE=(%04=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3))),
IFTHEN=(WHEN=(1,11,CH,EQ,C'>CUST LOC1,'),
PARSE=(%05=(ABSPOS=12,ENDBEFR=C' ',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CL01'),
PARSE=(%06=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3),
%07=(ABSPOS=10,ENDBEFR=C' ',FIXLEN=15))),
IFTHEN=(WHEN=(1,12,CH,EQ,C'>CUST CONT$,'),
PARSE=(%08=(ABSPOS=13,ENDBEFR=C' ',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CC02'),
PARSE=(%09=(ABSPOS=06,FIXLEN=3),
%10=(ABSPOS=10,FIXLEN=2),
%11=(ABSPOS=13,FIXLEN=1),
%12=(ABSPOS=15,FIXLEN=1),
%13=(ABSPOS=17,FIXLEN=5))),
BUILD=(%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'))
%02,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%03,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%04,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%05,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%06,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%07,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%08,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%09,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%11,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%12,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'))
I am trying to create two output sets, but since I did not get the first
to work, I did not even try the second. Hopefully someone can put me on the
right track.
I have attached a file with the data layout (it won't display right in
HTML with multiple embedded spaces).
Thanks for lending a hand here, and happy new year!
Billy
--
Thank you and best regards,
*Billy Ashton*
--
Thank you and best regards,
*Billy Ashton*

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Bill Ashton
2017-12-29 16:20:59 UTC
Permalink
HI Kolusu, in the original post is an attached file showing the input
layout (data has been scrubbed) containing only the relevant data. Here it
is again for you. Let me know if that is not good enough.

Billy
Post by Bill Ashton
INREC IFOUTLEN=245,
IFTHEN=(WHEN=(1,14,CH,EQ,C'C'>CUST MASTER$,'),
PARSE=(%01=(ABSPOS=15,ENDBEFR=C'(',FIXLEN=50))),
$
ICE107A 6 DUPLICATE, CONFLICTING, OR MISSING INREC OR OUTREC STATEMENT
OPERANDS
BUILD=(%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'))
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
*
Post by Bill Ashton
Hello! I am trying to use DFSORT to extract some records from a
transaction work file to be displayed in Microsoft Excel (and also on the
mainframe).
The data contains a lot of hierarchical information (Customer, Region,
Location, and contact people), and I would like to create a single record
for each contact containing the whole hierarchy. I coded what I thought was
the correct SORT statements, but I still get a confusing error on my INREC
statement.
I even cut the input down to a single IfTHEN statement, and that still
flunked. I would appreciate Kolusu or someone else taking a look at this to
see what I have missed.
OPTION COPY,VLSCMP IT IS NOT REQUIRED, BUT USEFUL
*
INCLUDE COND=(1,04,CH,EQ,C'CM03',OR,
1,04,CH,EQ,C'CR02',OR,
1,04,CH,EQ,C'CL01',OR,
1,04,CH,EQ,C'CC02',OR,
1,14,CH,EQ,C'>CUST MASTER$,',OR,
1,10,CH,EQ,C'>CUST REG,',OR,
1,11,CH,EQ,C'>CUST LOC1,',OR,
1,12,CH,EQ,C'>CUST CONT$,')
INREC IFOUTLEN=245,
IFTHEN=(WHEN=(1,14,CH,EQ,C'>CUST MASTER$,'),
PARSE=(%01=(ABSPOS=15,ENDBEFR=C'(',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CM03'),
PARSE=(%02=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=5))),
IFTHEN=(WHEN=(1,10,CH,EQ,C'>CUST REG,'),
PARSE=(%03=(ABSPOS=11,ENDBEFR=C'(',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CR02'),
PARSE=(%04=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3))),
IFTHEN=(WHEN=(1,11,CH,EQ,C'>CUST LOC1,'),
PARSE=(%05=(ABSPOS=12,ENDBEFR=C' ',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CL01'),
PARSE=(%06=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3),
%07=(ABSPOS=10,ENDBEFR=C' ',FIXLEN=15))),
IFTHEN=(WHEN=(1,12,CH,EQ,C'>CUST CONT$,'),
PARSE=(%08=(ABSPOS=13,ENDBEFR=C' ',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CC02'),
PARSE=(%09=(ABSPOS=06,FIXLEN=3),
%10=(ABSPOS=10,FIXLEN=2),
%11=(ABSPOS=13,FIXLEN=1),
%12=(ABSPOS=15,FIXLEN=1),
%13=(ABSPOS=17,FIXLEN=5))),
BUILD=(%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'))
%02,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%03,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%04,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%05,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%06,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%07,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%08,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%09,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%11,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%12,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'))
I am trying to create two output sets, but since I did not get the first
to work, I did not even try the second. Hopefully someone can put me on the
right track.
I have attached a file with the data layout (it won't display right in
HTML with multiple embedded spaces).
Thanks for lending a hand here, and happy new year!
Billy
--
Thank you and best regards,
*Billy Ashton*
--
Thank you and best regards,
*Billy Ashton*
--
Thank you and best regards,
*Billy Ashton*

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Bill Ashton
2017-12-29 16:22:01 UTC
Permalink
The original file is 80 bytes long, so you can copy this into an 80-byte
file, and get rid of everything in the [ ] pair if you want.
Post by Bill Ashton
HI Kolusu, in the original post is an attached file showing the input
layout (data has been scrubbed) containing only the relevant data. Here it
is again for you. Let me know if that is not good enough.
Billy
Post by Bill Ashton
INREC IFOUTLEN=245,
IFTHEN=(WHEN=(1,14,CH,EQ,C'C'>CUST MASTER$,'),
PARSE=(%01=(ABSPOS=15,ENDBEFR=C'(',FIXLEN=50))),
$
ICE107A 6 DUPLICATE, CONFLICTING, OR MISSING INREC OR OUTREC STATEMENT
OPERANDS
BUILD=(%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'))
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
*
Post by Bill Ashton
Hello! I am trying to use DFSORT to extract some records from a
transaction work file to be displayed in Microsoft Excel (and also on the
mainframe).
The data contains a lot of hierarchical information (Customer, Region,
Location, and contact people), and I would like to create a single record
for each contact containing the whole hierarchy. I coded what I thought was
the correct SORT statements, but I still get a confusing error on my INREC
statement.
I even cut the input down to a single IfTHEN statement, and that still
flunked. I would appreciate Kolusu or someone else taking a look at this to
see what I have missed.
OPTION COPY,VLSCMP IT IS NOT REQUIRED, BUT USEFUL
*
INCLUDE COND=(1,04,CH,EQ,C'CM03',OR,
1,04,CH,EQ,C'CR02',OR,
1,04,CH,EQ,C'CL01',OR,
1,04,CH,EQ,C'CC02',OR,
1,14,CH,EQ,C'>CUST MASTER$,',OR,
1,10,CH,EQ,C'>CUST REG,',OR,
1,11,CH,EQ,C'>CUST LOC1,',OR,
1,12,CH,EQ,C'>CUST CONT$,')
INREC IFOUTLEN=245,
IFTHEN=(WHEN=(1,14,CH,EQ,C'>CUST MASTER$,'),
PARSE=(%01=(ABSPOS=15,ENDBEFR=C'(',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CM03'),
PARSE=(%02=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=5))),
IFTHEN=(WHEN=(1,10,CH,EQ,C'>CUST REG,'),
PARSE=(%03=(ABSPOS=11,ENDBEFR=C'(',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CR02'),
PARSE=(%04=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3))),
IFTHEN=(WHEN=(1,11,CH,EQ,C'>CUST LOC1,'),
PARSE=(%05=(ABSPOS=12,ENDBEFR=C' ',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CL01'),
PARSE=(%06=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3),
%07=(ABSPOS=10,ENDBEFR=C' ',FIXLEN=15))),
IFTHEN=(WHEN=(1,12,CH,EQ,C'>CUST CONT$,'),
PARSE=(%08=(ABSPOS=13,ENDBEFR=C' ',FIXLEN=50))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CC02'),
PARSE=(%09=(ABSPOS=06,FIXLEN=3),
%10=(ABSPOS=10,FIXLEN=2),
%11=(ABSPOS=13,FIXLEN=1),
%12=(ABSPOS=15,FIXLEN=1),
%13=(ABSPOS=17,FIXLEN=5))),
BUILD=(%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'))
%02,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%03,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%04,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%05,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%06,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%07,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%08,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%09,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%11,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",'),
%12,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'))
I am trying to create two output sets, but since I did not get the first
to work, I did not even try the second. Hopefully someone can put me on the
right track.
I have attached a file with the data layout (it won't display right in
HTML with multiple embedded spaces).
Thanks for lending a hand here, and happy new year!
Billy
--
Thank you and best regards,
*Billy Ashton*
--
Thank you and best regards,
*Billy Ashton*
--
Thank you and best regards,
*Billy Ashton*
--
Thank you and best regards,
*Billy Ashton*

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Sri h Kolusu
2017-12-29 17:57:45 UTC
Permalink
Bill,

Use the following JCL which will give you the desired results

//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=your input FB 80 byte file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY

INREC IFOUTLEN=520,
IFTHEN=(WHEN=(1,14,CH,EQ,C'>CUST MASTER$,'),
PARSE=(%01=(ABSPOS=15,ENDBEFR=C'(',FIXLEN=50)),
OVERLAY=(081:%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=53))),

IFTHEN=(WHEN=(1,04,CH,EQ,C'CM03'),
PARSE=(%02=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=5)),
OVERLAY=(134:%02,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=08))),

IFTHEN=(WHEN=(1,10,CH,EQ,C'>CUST REG,'),
PARSE=(%03=(ABSPOS=11,ENDBEFR=C'(',FIXLEN=50)),
OVERLAY=(142:%03,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=53))),

IFTHEN=(WHEN=(1,04,CH,EQ,C'CR02'),
PARSE=(%04=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3)),
OVERLAY=(195:%04,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=06))),

IFTHEN=(WHEN=(1,11,CH,EQ,C'>CUST LOC1,'),
PARSE=(%05=(ABSPOS=12,ENDBEFR=C' ',FIXLEN=50)),
OVERLAY=(201:%05,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=53))),

IFTHEN=(WHEN=(1,04,CH,EQ,C'CL01'),
PARSE=(%06=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3),
%07=(ABSPOS=10,ENDBEFR=C' ',FIXLEN=15)),
OVERLAY=(254:%06,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=6),
260:%07,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=18))),


IFTHEN=(WHEN=(1,12,CH,EQ,C'>CUST CONT$,'),
PARSE=(%08=(ABSPOS=13,ENDBEFR=C' ',FIXLEN=50)),
OVERLAY=(278:%08,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=53),
521:SEQNUM,8,ZD,START=3,
530:521,8,ZD,MOD,+3,EDIT=(T)),HIT=NEXT),

IFTHEN=(WHEN=(1,04,CH,EQ,C'CC02'),
PARSE=(%09=(ABSPOS=06,FIXLEN=3),
%10=(ABSPOS=10,FIXLEN=2),
%11=(ABSPOS=13,FIXLEN=1),
%12=(ABSPOS=15,FIXLEN=1),
%13=(ABSPOS=17,FIXLEN=5)),
OVERLAY=(331:%09,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=6),
337:%10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=5),
342:%11,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=4),
346:%12,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=4),
350:%13,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=8),
535:SEQNUM,8,ZD,START=3,
545:535,8,ZD,MOD,+3,EDIT=(T)),HIT=NEXT),

IFTHEN=(WHEN=(530,1,ZD,EQ,1),
OVERLAY=(357:278,53,
278:53X),HIT=NEXT),

IFTHEN=(WHEN=(530,1,ZD,EQ,2),
OVERLAY=(437:278,53,
278:53X),HIT=NEXT),

IFTHEN=(WHEN=(545,1,ZD,EQ,1),
OVERLAY=(410:331,27,
331:27X)),


IFTHEN=(WHEN=(545,1,ZD,EQ,2),
OVERLAY=(490:331,26,
331:27X))

OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,14,CH,EQ,C'>CUST MASTER$,'),
PUSH=(521:ID=8)),
IFTHEN=(WHEN=GROUP,BEGIN=(081,1,CH,EQ,C'"'),
PUSH=(081:081,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(134,1,CH,EQ,C'"'),
PUSH=(134:134,08)),
IFTHEN=(WHEN=GROUP,BEGIN=(142,1,CH,EQ,C'"'),
PUSH=(142:142,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(195,1,CH,EQ,C'"'),
PUSH=(195:195,06)),
IFTHEN=(WHEN=GROUP,BEGIN=(201,1,CH,EQ,C'"'),
PUSH=(201:201,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(254,1,CH,EQ,C'"'),
PUSH=(254:254,06)),
IFTHEN=(WHEN=GROUP,BEGIN=(260,1,CH,EQ,C'"'),
PUSH=(260:260,18)),
IFTHEN=(WHEN=GROUP,BEGIN=(278,1,CH,EQ,C'"'),
PUSH=(278:278,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(331,1,CH,EQ,C'"'),
PUSH=(331:331,26)),
IFTHEN=(WHEN=GROUP,BEGIN=(357,1,CH,EQ,C'"'),
PUSH=(357:357,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(410,1,CH,EQ,C'"'),
PUSH=(410:410,27)),
IFTHEN=(WHEN=GROUP,BEGIN=(437,1,CH,EQ,C'"'),
PUSH=(437:437,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(490,1,CH,EQ,C'"'),
PUSH=(490:490,26)),
IFTHEN=(WHEN=INIT,
OVERLAY=(081:081,440,SQZ=(SHIFT=LEFT,PAIR=QUOTE)))

OUTFIL REMOVECC,NODETAIL,BUILD=(440X),
SECTIONS=(521,8,
TRAILER3=(81,440))
//*

Kolusu
DFSORT Development
IBM Corporation



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Bill Ashton
2017-12-29 21:11:20 UTC
Permalink
Thanks, Kolusu; I will be leaving shortly, too, and will give this a try in
the next week or so. I never imagined it would be so complex, but I will
try to figure it out.

Happy new year!
Billy
Post by Sri h Kolusu
Bill,
Use the following JCL which will give you the desired results
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=your input FB 80 byte file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=520,
IFTHEN=(WHEN=(1,14,CH,EQ,C'>CUST MASTER$,'),
PARSE=(%01=(ABSPOS=15,ENDBEFR=C'(',FIXLEN=50)),
OVERLAY=(081:%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=53))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CM03'),
PARSE=(%02=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=5)),
OVERLAY=(134:%02,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=08))),
IFTHEN=(WHEN=(1,10,CH,EQ,C'>CUST REG,'),
PARSE=(%03=(ABSPOS=11,ENDBEFR=C'(',FIXLEN=50)),
OVERLAY=(142:%03,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=53))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CR02'),
PARSE=(%04=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3)),
OVERLAY=(195:%04,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=06))),
IFTHEN=(WHEN=(1,11,CH,EQ,C'>CUST LOC1,'),
PARSE=(%05=(ABSPOS=12,ENDBEFR=C' ',FIXLEN=50)),
OVERLAY=(201:%05,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=53))),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CL01'),
PARSE=(%06=(ABSPOS=06,ENDBEFR=C' ',FIXLEN=3),
%07=(ABSPOS=10,ENDBEFR=C' ',FIXLEN=15)),
OVERLAY=(254:%06,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=6),
260:%07,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=18))),
IFTHEN=(WHEN=(1,12,CH,EQ,C'>CUST CONT$,'),
PARSE=(%08=(ABSPOS=13,ENDBEFR=C' ',FIXLEN=50)),
OVERLAY=(278:%08,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=53),
521:SEQNUM,8,ZD,START=3,
530:521,8,ZD,MOD,+3,EDIT=(T)),HIT=NEXT),
IFTHEN=(WHEN=(1,04,CH,EQ,C'CC02'),
PARSE=(%09=(ABSPOS=06,FIXLEN=3),
%10=(ABSPOS=10,FIXLEN=2),
%11=(ABSPOS=13,FIXLEN=1),
%12=(ABSPOS=15,FIXLEN=1),
%13=(ABSPOS=17,FIXLEN=5)),
OVERLAY=(331:%09,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=6),
337:%10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=5),
342:%11,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=4),
346:%12,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=4),
350:%13,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'",',
LENGTH=8),
535:SEQNUM,8,ZD,START=3,
545:535,8,ZD,MOD,+3,EDIT=(T)),HIT=NEXT),
IFTHEN=(WHEN=(530,1,ZD,EQ,1),
OVERLAY=(357:278,53,
278:53X),HIT=NEXT),
IFTHEN=(WHEN=(530,1,ZD,EQ,2),
OVERLAY=(437:278,53,
278:53X),HIT=NEXT),
IFTHEN=(WHEN=(545,1,ZD,EQ,1),
OVERLAY=(410:331,27,
331:27X)),
IFTHEN=(WHEN=(545,1,ZD,EQ,2),
OVERLAY=(490:331,26,
331:27X))
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,14,CH,EQ,C'>CUST MASTER$,'),
PUSH=(521:ID=8)),
IFTHEN=(WHEN=GROUP,BEGIN=(081,1,CH,EQ,C'"'),
PUSH=(081:081,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(134,1,CH,EQ,C'"'),
PUSH=(134:134,08)),
IFTHEN=(WHEN=GROUP,BEGIN=(142,1,CH,EQ,C'"'),
PUSH=(142:142,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(195,1,CH,EQ,C'"'),
PUSH=(195:195,06)),
IFTHEN=(WHEN=GROUP,BEGIN=(201,1,CH,EQ,C'"'),
PUSH=(201:201,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(254,1,CH,EQ,C'"'),
PUSH=(254:254,06)),
IFTHEN=(WHEN=GROUP,BEGIN=(260,1,CH,EQ,C'"'),
PUSH=(260:260,18)),
IFTHEN=(WHEN=GROUP,BEGIN=(278,1,CH,EQ,C'"'),
PUSH=(278:278,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(331,1,CH,EQ,C'"'),
PUSH=(331:331,26)),
IFTHEN=(WHEN=GROUP,BEGIN=(357,1,CH,EQ,C'"'),
PUSH=(357:357,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(410,1,CH,EQ,C'"'),
PUSH=(410:410,27)),
IFTHEN=(WHEN=GROUP,BEGIN=(437,1,CH,EQ,C'"'),
PUSH=(437:437,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(490,1,CH,EQ,C'"'),
PUSH=(490:490,26)),
IFTHEN=(WHEN=INIT,
OVERLAY=(081:081,440,SQZ=(SHIFT=LEFT,PAIR=QUOTE)))
OUTFIL REMOVECC,NODETAIL,BUILD=(440X),
SECTIONS=(521,8,
TRAILER3=(81,440))
//*
Kolusu
DFSORT Development
IBM Corporation
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
Thank you and best regards,
*Billy Ashton*

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Sri h Kolusu
2018-01-02 15:26:31 UTC
Permalink
I never imagined it would be so complex, but I will try to figure it
out.

Bill,

To begin you have about 16 individual records for each group and you
wanted bits and pieces from each and then merge them into a single line.
You also had 3 different customer contact data which needs to be handled
as all of them start at the same position.

The INREC is used to parse the data and pick the required fields
The OUTREC is used to merge the required fields into a single record using
WHEN=GROUP
The OUTFIL is used to write out the single record from a group of 16
records.

I noticed that I missed a comma for the 2 contact fields as I only pushed
26 bytes instead of 27. So please change the last 4 IFTHEN statements and
the corresponding IFTHEN=(WHEN=GROUP statements


IFTHEN=(WHEN=(530,1,ZD,EQ,1),
OVERLAY=(358:278,53,
278:53X),HIT=NEXT),

IFTHEN=(WHEN=(530,1,ZD,EQ,2),
OVERLAY=(438:278,53,
278:53X),HIT=NEXT),

IFTHEN=(WHEN=(545,1,ZD,EQ,1),
OVERLAY=(411:331,27,
331:27X)),

IFTHEN=(WHEN=(545,1,ZD,EQ,2),
OVERLAY=(491:331,26,
331:27X))

IFTHEN=(WHEN=GROUP,BEGIN=(331,1,CH,EQ,C'"'),
PUSH=(331:331,27)),
IFTHEN=(WHEN=GROUP,BEGIN=(358,1,CH,EQ,C'"'),
PUSH=(358:358,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(411,1,CH,EQ,C'"'),
PUSH=(411:411,27)),
IFTHEN=(WHEN=GROUP,BEGIN=(438,1,CH,EQ,C'"'),
PUSH=(438:438,53)),
IFTHEN=(WHEN=GROUP,BEGIN=(491,1,CH,EQ,C'"'),
PUSH=(491:491,26)),


Thanks,
Kolusu



From: Bill Ashton <***@GMAIL.COM>
To: IBM-***@LISTSERV.UA.EDU
Date: 12/29/2017 02:13 PM
Subject: Re: Problem creating file of combined records with SORT
Sent by: IBM Mainframe Discussion List <IBM-***@LISTSERV.UA.EDU>



Thanks, Kolusu; I will be leaving shortly, too, and will give this a try
in
the next week or so. I never imagined it would be so complex, but I will
try to figure it out.

Happy new year!
Billy






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