Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need comma delimiter in Total line Easytrieve
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
tapas84

New User


Joined: 12 Mar 2009
Posts: 23
Location: Bangalore

PostPosted: Mon May 16, 2011 9:11 pm    Post subject: Need comma delimiter in Total line Easytrieve
Reply with quote

HI,
My current output is like below:
Code:


POLICY PRODUCT      GROUP                         SUMMARY                       BILL-RATE            QTY           WS-BILL-AMTT

 5122  ;ADSG5843;SHP031J5850SBN ;02 = Member Communications - Member Request;          0.560;                1 ;              .56 ;
 5122  ;ADSG5843;SHP031J5850SBN ;02 = Member Communications - Member Request;          0.590;                1 ;              .59 ;
 5122  ;ADSG5843;SHP031J5850SBN ;02 = Member Communications - Member Request;          0.400;                1 ;              .40 ;
 5122  ;ADSG5843;SHP031J5850SBN ;02 = Member Communications - Member Request;          0.840;                1 ;              .84 ;
 5122  ;ADVH5850;SHP020H5850L1BD;02 = Member Communications - Member Request;          0.640;                1 ;              .59 ;
SUMMARY TOTAL                                                                          3.030                 5               2.98

PRODUCT TOTAL                                                                          3.030                 5               2.98

But I need the output like below where in each every line there will be comma delimiter. In the current output, for the Total line the fields are not separated by comma delimiter.

Code:


POLICY PRODUCT      GROUP                         SUMMARY                       BILL-RATE            QTY           WS-BILL-AMTT

 5122  ;ADSG5843;SHP031J5850SBN ;02 = Member Communications - Member Request;          0.560;                1 ;              .56 ;
 5122  ;ADSG5843;SHP031J5850SBN ;02 = Member Communications - Member Request;          0.590;                1 ;              .59 ;
 5122  ;ADSG5843;SHP031J5850SBN ;02 = Member Communications - Member Request;          0.400;                1 ;              .40 ;
 5122  ;ADSG5843;SHP031J5850SBN ;02 = Member Communications - Member Request;          0.840;                1 ;              .84 ;
 5122  ;ADVH5850;SHP020H5850L1BD;02 = Member Communications - Member Request;          0.640;                1 ;              .59 ;
SUMMARY TOTAL                                                               ;          3.030;                5 ;             2.98 ;

PRODUCT TOTAL                                                               ;          3.030;                5 ;             2.98 ;


My current code for the above report is like below:

Code:


REPORT REPORT8 SPACE 0 TALLYSIZE 10 PRINTER FILEC NOADJUST NODATE +     01140000
        LINESIZE 132 NOPAGE DTLCTL EVERY SUMCTL TAG                     01150000
SEQUENCE POLICY  PRODUCT GROUP SUMMARY                                  01160000
CONTROL  POLICY  PRODUCT  SUMMARY                                       01170000
LINE 01  POLICY ';' PRODUCT ';' GROUP ';' SUMMARY ';' BILL-RATE +       01180000
          ';' QTY ';' WS-BILL-AMT ';'                                   01190000





Please suggest me the Easytrieve code to do the same.
Thanks
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Mon May 16, 2011 11:57 pm    Post subject: Reply to: Need comma delimiter in Total line Easytrieve
Reply with quote

This one, ";", I call a semi-colon. This one, ",", I call a comma. I think it is more widely accepted that way than just being me.

Have a look in the manual, SUMCTL DTLCOPY. Might do it for you.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue May 17, 2011 4:42 am    Post subject: Reply to: Need comma delimiter in Total line Easytrieve
Reply with quote

...or DTLCOPYALL...

You are sequencing on GROUP ahead of SUMMARY but not using GROUP as a CONTROL. If GROUP changes but SUMMARY doesn't, you won't get a break. I don't know if that is what you want.
Back to top
View user's profile Send private message
tapas84

New User


Joined: 12 Mar 2009
Posts: 23
Location: Bangalore

PostPosted: Tue May 17, 2011 1:18 pm    Post subject: Re: Reply to: Need comma delimiter in Total line Easytrieve
Reply with quote

Bill Woodger wrote:
This one, ";", I call a semi-colon. This one, ",", I call a comma. I think it is more widely accepted that way than just being me.

Have a look in the manual, SUMCTL DTLCOPY. Might do it for you.


yeah it is semi-colon..a typo..
Back to top
View user's profile Send private message
tapas84

New User


Joined: 12 Mar 2009
Posts: 23
Location: Bangalore

PostPosted: Tue May 17, 2011 2:10 pm    Post subject: Re: Reply to: Need comma delimiter in Total line Easytrieve
Reply with quote

Bill Woodger wrote:
...or DTLCOPYALL...

You are sequencing on GROUP ahead of SUMMARY but not using GROUP as a CONTROL. If GROUP changes but SUMMARY doesn't, you won't get a break. I don't know if that is what you want.


Hi Bill,

I am using control break for Policy, Product and Summary and this is ok.

My requirement is to print semi colon(;) at the Total line after bill-rate,qty and ws-bill-amtt. Please refer my first post for better understanding.

Please let me know your suggestion. And let me know if you have any questions.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue May 17, 2011 3:59 pm    Post subject: Reply to: Need comma delimiter in Total line Easytrieve
Reply with quote

Did you try SUMCTL DTLCOPY/DTLCOPYALL as I suggested? Should copy the detail line onto the total lines, like it says in the manual. You have SUMCTL TAG already. Try it and see.

If you are happy with the CONTROL, that's fine by me. Group changes, sometimes you'll get a break (for SUMMARY, sometimes you won't. Seems odd to me, but up to you.

Code:

GROUP 1 SUMMARY A
GROUP 2 SUMMARY A *
GROUP 2 SUMMARY B *
GROUP 3 SUMMARY C *

* = break. No break for change to group 2, because summary is the same. Sometimes you will have summary totals across groups, sometimes not, depending on the summary values which are possible.

It is usual to not need to have CONTROL for all items in the SEQUENCE, but usually without leaving a gap so that you CONTROL on a lower sequenced item.

I've said enough. Up to you.
Back to top
View user's profile Send private message
tapas84

New User


Joined: 12 Mar 2009
Posts: 23
Location: Bangalore

PostPosted: Tue May 17, 2011 4:39 pm    Post subject: Re: Reply to: Need comma delimiter in Total line Easytrieve
Reply with quote

Bill Woodger wrote:
Did you try SUMCTL DTLCOPY/DTLCOPYALL as I suggested? Should copy the detail line onto the total lines, like it says in the manual. You have SUMCTL TAG already. Try it and see.

If you are happy with the CONTROL, that's fine by me. Group changes, sometimes you'll get a break (for SUMMARY, sometimes you won't. Seems odd to me, but up to you.

Code:

GROUP 1 SUMMARY A
GROUP 2 SUMMARY A *
GROUP 2 SUMMARY B *
GROUP 3 SUMMARY C *

* = break. No break for change to group 2, because summary is the same. Sometimes you will have summary totals across groups, sometimes not, depending on the summary values which are possible.

It is usual to not need to have CONTROL for all items in the SEQUENCE, but usually without leaving a gap so that you CONTROL on a lower sequenced item.

I've said enough. Up to you.


Hi Bill,

Thanks for your advise. I tried with sumctl Dtlcopy/Dtlcopyall Tag. But it didn't work .it says *******B016 INVALID OR CONFLICTING KEYWORD.

If I remove the Tag , then the total line is not printing.

Please advise.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue May 17, 2011 5:01 pm    Post subject:
Reply with quote

Try "SUMCTL TAG DTLCOPYALL" first. If that gives you too much, "SUMCTL TAG DTLCOPY" will only copy the detail (into blank fields, ie the non-summed fields) on the LEVEL 1 break.

It is all in the manual. Do you have one?

By the "total line not printing" do you mean the word "TOTAL" and the particular break field do not appear? Because that is what TAG does. Without TAG, they won't appear like that.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue May 17, 2011 5:29 pm    Post subject:
Reply with quote

The TS wants ";" appended to the total lines/fields. That is not possible.
Maybe with a SUMFILE or using Special-name Report Procedures, its all in the manual (but i have to say its difficult reading)
Back to top
View user's profile Send private message
tapas84

New User


Joined: 12 Mar 2009
Posts: 23
Location: Bangalore

PostPosted: Tue May 17, 2011 5:30 pm    Post subject:
Reply with quote

Bill Woodger wrote:
Try "SUMCTL TAG DTLCOPYALL" first. If that gives you too much, "SUMCTL TAG DTLCOPY" will only copy the detail (into blank fields, ie the non-summed fields) on the LEVEL 1 break.

It is all in the manual. Do you have one?

By the "total line not printing" do you mean the word "TOTAL" and the particular break field do not appear? Because that is what TAG does. Without TAG, they won't appear like that.


Hi Bill,

Thanks for your advise.

When I tried ''SUMCTL TAG DTLCOPYALL'' it gave me error like

*******B016 INVALID OR CONFLICTING KEYWORD - DTLCOPYALL

and after this I tried "SUMCTL TAG DTLCOPY" and it gave me error like

*******B016 INVALID OR CONFLICTING KEYWORD - DTLCOPY

Please advise. and please correct me if I have not used both the command correctly
Back to top
View user's profile Send private message
tapas84

New User


Joined: 12 Mar 2009
Posts: 23
Location: Bangalore

PostPosted: Tue May 17, 2011 5:35 pm    Post subject:
Reply with quote

PeterHolland wrote:
The TS wants ";" appended to the total lines/fields. That is not possible.
Maybe with a SUMFILE or using Special-name Report Procedures, its all in the manual (but i have to say its difficult reading)


Hi Peter,

I tried with BEFORE-BREAK and few other procedures , but it didn't work for me.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue May 17, 2011 6:05 pm    Post subject:
Reply with quote

Try to use CONTROL FINAL fieldname NOPRINT and in your BEFORE-BREAK proc a DISPLAY for your fields, literals and control fields.
But to be fair i never used all that summing and control stuff, too difficult and no good samples at all. So i wish you good luck.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue May 17, 2011 7:35 pm    Post subject: Reply to: Need comma delimiter in Total line Easytrieve
Reply with quote

Code:

[SUMCTL {( [HIAR][DTLCOPY ])}] + }
[ { [NONE][DTLCOPYALL] }] }
[ { [TAG ][ ] }] }
[ { [ ][ ] }] }



Code:

DTLCOPY
When printing control reports (particularly a summary report) you can include
detail information in total lines. Normally, CA-Easytrieve/Plus prints only
control field values and associated totals on total lines. The DTLCOPY
subparameter of SUMCTL causes detail field contents (values just prior to the
break) to be printed on total lines.


DTLCOPY or DTLCOPYALL will do what you want. Although not clear when I put it in the code tags, according to the manual you should be able to do SUMCTL TAG DTLCOPY.

Just for fun, take the TAG off and see it DTLCOPY/DTLCOPYALL will give you what you want. You might have to make the semi-colon a data-name, I can't remember.

If it works that way (syntax checks) but not with TAG, you could do either the colons or TOTAL (that TAG is doing) in a report procedure (like BEFORE-BREAK) as Peter has suggested.

I never used TAG, but DTLCOPY a lot. Maybe in the manual it is just a list of mutually exclusive options which has wrapped into a second column, I don't get it.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue May 17, 2011 9:05 pm    Post subject: Reply to: Need comma delimiter in Total line Easytrieve
Reply with quote

Looked at an old manual. TAG/DTLCOPY mutually exclusive. Sorry, misunderstood the new manual.

BEFORE-BREAK report procedure then. LEVEL EQ 1 is for lowest level break, EQ 2, EQ 3.

You'll have to have NOPRINT on the CONTROL fields. Forget the TAG, you'll have to do that in the BEFORE-BREAK as well.

DISPLAY your ordinary fields, they'll have the "SUM" in this procedure. Display your semi-colon. Try to use POS to get things to line up easily.
Back to top
View user's profile Send private message
tapas84

New User


Joined: 12 Mar 2009
Posts: 23
Location: Bangalore

PostPosted: Tue May 17, 2011 11:30 pm    Post subject: Re: Reply to: Need comma delimiter in Total line Easytrieve
Reply with quote

Bill Woodger wrote:
Looked at an old manual. TAG/DTLCOPY mutually exclusive. Sorry, misunderstood the new manual.

BEFORE-BREAK report procedure then. LEVEL EQ 1 is for lowest level break, EQ 2, EQ 3.

You'll have to have NOPRINT on the CONTROL fields. Forget the TAG, you'll have to do that in the BEFORE-BREAK as well.

DISPLAY your ordinary fields, they'll have the "SUM" in this procedure. Display your semi-colon. Try to use POS to get things to line up easily.


Hi Bill,

Thanks for the reply.I am not quiet sure about the BEFORE-BREAK logic. I tried but couldn't able to get the SUM of the fields as total line in my report .Could you please give me an example or sample code. It would be a great help for me. Thanks
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed May 18, 2011 4:44 am    Post subject:
Reply with quote

Hi Tapas,

'Spose I owe you one. I missed your requirement and sent you off on a goose chase, so...

This is the break procedure. I've done it with CASE, because I never got to use that. The POS is to line up correctly with the items on the LINE statement. So, POS 8 lines up with the 8th item on the LINE.

Don't particularly like the CASE, as it can only have literals. So also done it with IF. Obviously, choose one or the other.

Code:

BEFORE-BREAK. PROC

    CASE LEVEL
        WHEN 1
            DISPLAY S-SUMMARY-TOTAL-DESC +
                         POS 08 S-FIELD-DELIMITER +
                         POS 09 BILL-RATE +
                         POS 10 S-FIELD-DELIMITER +
                         POS 11 QTY +
                         POS 12 S-FIELD-DELIMITER +
                         POS 11 WS-BILL-AMT +
                         POS 12 S-FIELD-DELIMITER
        WHEN 2
            DISPLAY S-PRODUCT-TOTAL-DESC +
                         POS 08 S-FIELD-DELIMITER +
                         POS 09 BILL-RATE +
                         POS 10 S-FIELD-DELIMITER +
                         POS 11 QTY +
                         POS 12 S-FIELD-DELIMITER +
                         POS 11 WS-BILL-AMT +
                         POS 12 S-FIELD-DELIMITER
        WHEN 3
            DISPLAY S-POLICY-TOTAL-DESC +
                         POS 08 S-FIELD-DELIMITER +
                         POS 09 BILL-RATE +
                         POS 10 S-FIELD-DELIMITER +
                         POS 11 QTY +
                         POS 12 S-FIELD-DELIMITER +
                         POS 11 WS-BILL-AMT +
                         POS 12 S-FIELD-DELIMITER
        OTHERWISE
            DISPLAY S-PROGRAM +
                          S-REPORT +
                         "UNKNOWN LEVEL IN BEFORE-BREAK. LEVEL IS >" +
                         LEVEL +
                         "<"
    END-CASE

END-PROC


Code:

BEFORE-BREAK. PROC

    IF LEVEL EQ S-SUMMARY-BREAK
        DISPLAY S-SUMMARY-TOTAL-DESC +
                     POS 08 S-FIELD-DELIMITER +
                     POS 09 BILL-RATE +
                     POS 10 S-FIELD-DELIMITER +
                     POS 11 QTY +
                     POS 12 S-FIELD-DELIMITER +
                     POS 11 WS-BILL-AMT +
                     POS 12 S-FIELD-DELIMITER
    ELSE
    IF LEVEL EQ S-PRODUCT-BREAK
        DISPLAY S-PRODUCT-TOTAL-DESC +
                     POS 08 S-FIELD-DELIMITER +
                     POS 09 BILL-RATE +
                     POS 10 S-FIELD-DELIMITER +
                     POS 11 QTY +
                     POS 12 S-FIELD-DELIMITER +
                     POS 11 WS-BILL-AMT +
                     POS 12 S-FIELD-DELIMITER
    ELSE
    IF LEVEL EQ S-POLICY-BREAK
        DISPLAY S-POLICY-TOTAL-DESC +
                     POS 08 S-FIELD-DELIMITER +
                     POS 09 BILL-RATE +
                     POS 10 S-FIELD-DELIMITER +
                     POS 11 QTY +
                     POS 12 S-FIELD-DELIMITER +
                     POS 11 WS-BILL-AMT +
                     POS 12 S-FIELD-DELIMITER
        ELSE
          DISPLAY S-PROGRAM +
                      S-REPORT +
                     "UNKNOWN LEVEL IN BEFORE-BREAK. LEVEL IS >" +
                     LEVEL +
                     "<"
    END-IF
    END-IF
    END-IF

END-PROC


Some data to define. Don't need the last three unless you use the IF (my preference).

Code:

    S-PROGRAM                             S 08 A VALUE "PROGNM"
    S-REPORT                              S 20 A VALUE "REPORT 8"
    S-SUMMARY-TOTAL-DESC                  S 15 A VALUE "SUMMARY TOTAL"
    S-SUMMARY-TOTAL-DESC                  S 15 A VALUE "PRODUCT TOTAL"
    S-POLICY-TOTAL-DESC                   S 15 A VALUE "POLICY TOTAL"
    S-FIELD-DELIMITER                     S 01 A VALUE ";"


    S-SUMMARY-BREAK                       S 01 P 0 VALUE +1
    S-PRODUCT-BREAK                       S 01 P 0 VALUE +2
    S-POLICY-BREAK                        S 01 P 0 VALUE +3


I did your report statement for you. Not necessary to change the literals, but I prefer it like that. Formatting the statements like this I find them much easier to read.

Code:

REPORT +
    REPORT8 +
        SPACE 0 +
        TALLYSIZE 10 +
        PRINTER FILEC +
        NOADJUST +
        NODATE +     
        LINESIZE 132 +
        NOPAGE +
        DTLCTL EVERY

    SEQUENCE +
        POLICY  +
        PRODUCT +
        GROUP +
        SUMMARY                                 

    CONTROL +
          POLICY   NOPRINT  +
          PRODUCT  NOPRINT +
          SUMMARY  NOPRINT

LINE 01  +
    POLICY +
        S-FIELD-DELIMITER +
    PRODUCT +
        S-FIELD-DELIMITER +
    GROUP  +
        S-FIELD-DELIMITER +
    SUMMARY +
        S-FIELD-DELIMITER +
    BILL-RATE +                 
        S-FIELD-DELIMITER +
    QTY  +
        S-FIELD-DELIMITER +
    WS-BILL-AMT +
        S-FIELD-DELIMITER



Should do it. Approximately. This was with WordPad and no EZTPA00, so good luck.

Obviously the BEFORE-BREAK goes immediately after WS-BILL-AMT above.

As you are not letting Easytrieve print any totals, you could have used AFTER-BREAK as well, but I think better as "BEFORE".
Back to top
View user's profile Send private message
tapas84

New User


Joined: 12 Mar 2009
Posts: 23
Location: Bangalore

PostPosted: Wed May 18, 2011 12:49 pm    Post subject: Reply to: Need comma delimiter in Total line Easytrieve
Reply with quote

Thanks a lot Bill. I'll try this and let you know if it works for me.

Thank you again!!!!!!
Back to top
View user's profile Send private message
tapas84

New User


Joined: 12 Mar 2009
Posts: 23
Location: Bangalore

PostPosted: Wed May 18, 2011 4:40 pm    Post subject: Reply to: Need comma delimiter in Total line Easytrieve
Reply with quote

Hi Bill,

I have changed the code as per your advise, but I have some issue. I coded like below

Code:

BEFORE-BREAK. PROC                           
  IF LEVEL = WS-SUMMARY-BREAK                   
     DISPLAY WS-SUMMARY-TOTAL-DESC +         
             POS 78 WS-FIELD-DELIMITER +     
             POS 89 BILL-RATE +               
             POS 94 WS-FIELD-DELIMITER +     
             POS 100 QTY +                   
             POS 102 WS-FIELD-DELIMITER +     
             POS 126 WS-BILL-AMT +         
             POS 132 WS-FIELD-DELIMITER   
   END-IF


But I am getting error like below

Code:


ERROR

*******B021 PARAMETER IS TOO LARGE - 78   
              POS 94 WS-FIELD-DELIMITER +
*******B021 PARAMETER IS TOO LARGE - 89   
              POS 100 QTY +               
*******B021 PARAMETER IS TOO LARGE - 94   
              POS 102 WS-FIELD-DELIMITER +
*******B021 PARAMETER IS TOO LARGE - 100 
              POS 126 WS-BILL-AMT +   
*******B021 PARAMETER IS TOO LARGE - 102 
              POS 132 WS-FIELD-DELIMITER 
*******B021 PARAMETER IS TOO LARGE - 126 
*******B021 PARAMETER IS TOO LARGE - 132


Please advise. correct me If I am wrong.

Thanks
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed May 18, 2011 4:47 pm    Post subject:
Reply with quote

B021 PARAMETER IS TOO LARGE - word

The value of the indicated word is too large. Refer to the statement description for the valid range.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed May 18, 2011 5:53 pm    Post subject:
Reply with quote

Try with the original. Did you? POS is the field on the report line. So, POS 1 is first field, POS 2 second, etc.

If you want to line it up yourself, you have to use COL and then the start position number. I think you are mixing the two.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unwrap the data based on delimiter X'25' bhavana yalavarthi DFSORT/ICETOOL 22 Fri Dec 09, 2016 10:25 am
No new posts Easytrieve - Report writing - Only 1 ... Abhi Nature CA Products 2 Wed Sep 14, 2016 11:40 am
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts RACF Easytrieve Plus macro Susan Jackson CA Products 0 Fri Jun 03, 2016 8:25 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us