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 [email protected] with the message: INFO IBM-MAIN
>CUST MASTER$,CUSTOMER-NAME-VARLEN(ACT)      [#1: Starts pos 15, ends before 
>the "(" MaxLen=50]                          
CM01 ...
CM02 ...
CM03 01020 <more data here...>               [#2: Starts pos 6, len 5]
>CUST REG,REGION-NAME-VARLEN(ACT)            [#3: Starts pos 11, ends before 
>the "(" MaxLen=50]
CR01 ...
CR02 ECU <more data here...>                 [#4: Starts pos 6, len 3]        
>CUST LOC1,CITY-STATE VARLEN                 [#5: Starts pos 12, ends before 
>BLANK MaxLen=50]
CL01 USZ 25334-2418      <more data here...> [#6-#7: Starts pos6, len3; pos10, 
len15]   
>CUST CONT$,CUST-CONTACT1-VARLEN             [#8:Starts pos 13, ends before 
>BLANK MaxLen=50]
CC01 ...
CC02 ECU 01 S B 3045350000      <more data>  [#9-#13: pos6,len3; pos10,len2; 
pos13,len1; pos15,len1; pos17,len12]
>CUST CONT$,CUST-CONTACT-NAME2-VARLEN               [#8]                        
> 
CC02 SCU 02 C M 8179990000      <more data here...> [#9-#13]
>CUST CONT$,CUST-CONTACT-LONG-NAME3-VARLEN          [#8]                        
>         
CC02 SPA 01 P X 34911230000     <more data here...> [#9-#13]
. . .

output #1 CSV file with Commas/quotes:
"#1","#2","#3","#4","#5","#6","#7","#8","#9","#10","#11","#12","#13"
"#1","#2","#3","#4","#5","#6","#7","#8","#9","#10","#11","#12","#13"
...

output #2 Mainframe standard column file (the < and > are to identify the 
fields here):
<#1-Len50><#2-Len5><#3-Len50><#4-Len3><#5-Len50><#6-Len3><#7-Len15><#8-Len50><#9-Len3><#10-Len2><#11-Len1><#12-Len1><#13-Len12>
<#1-Len50><#2-Len5><#3-Len50><#4-Len3><#5-Len50><#6-Len3><#7-Len15><#8-Len50><#9-Len3><#10-Len2><#11-Len1><#12-Len1><#13-Len12>
...


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to