IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Report generation using TRAILER3


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Krishnadeva Reddy

New User


Joined: 14 Nov 2007
Posts: 37
Location: Chennai

PostPosted: Sat Oct 05, 2019 2:24 am
Reply with quote

Hello,

Can someone please help me out on the below query.

I have a input file
Code:

99 1 100.00 55.00 20.00
97 1 200.00 30.00 40.00
97 1   10.00 15.00 20.00
99 1   20.00   5.00 10.00


I can generate a report from the above input summing up the totals by SNO.
Code:

SNO   PAGE   CUS-NAME DOL$1  DOL$2 DOL$3
----- -----  --------  -------   ------ -----
99    1               120.00  60.00  30.00
97    1                 210      45.00  60.00


In the above report I need to populate CUS-NAME based on the SNO value (If SNO = 99, CUS-NAME should be 'ABC', If SNO = 97 CUS-NAME should be 'XYZ').

I tried with below SORT JCL but it is not working and giving syntax error.

Code:

SORT FIELDS=(1,5,A),FORMAT=CH
OUTFIL REMOVECC,NODETAIL,OUTREC=(1,5,6:80X),
HEADER2=(1:'SNO',5:'PAGE',9:'CUS-NAME ', 20:'DOL$1', 32:'DOL$2',44:'DOL$3'),
SECTIONS=(1,5,
IFTHEN=(WHEN=(1,2,CH,EQ,C'99'),BUILD=(9:'ABC')),
IFTHEN=(WHEN=(1,2,CH,EQ,C'97'),BUILD=(9:'XYZ')),
TRAILER3=(1:1,5,20:TOT=(8,12,SFF,EDIT=(SIIIIIIIT.TT),SIGNS=(,-)),
32:TOT=(21,12,SFF,EDIT=(SIIIIIIIT.TT),SIGNS=(,-)),
44:TOT=(34,12,SFF,EDIT=(SIIIIIIIT.TT),SIGNS=(,-))))


The SORT is working fine before I added IFTHEN statements. Please advise how can I populate the CUS-NAME based on the SNO value.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 513
Location: Bamberg, Germany

PostPosted: Sat Oct 05, 2019 6:49 pm
Reply with quote

1) What error messages were given?
2) IFTHEN are not allowed within SECTIONS
3) Move IFTHEN to INREC or OUTREC and do the logic there
4) Always consider a NOMATCH condition when assigning values
5) Read for CHANGE rather then having many IFTHENs

You could also work with SORT FIELDS and SUM instead of SECTIONS
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1079

PostPosted: Thu Oct 10, 2019 11:29 pm
Reply with quote

Krishnadeva Reddy wrote:
Code:

SORT FIELDS=(1,5,A),FORMAT=CH
OUTFIL REMOVECC,NODETAIL,OUTREC=(1,5,6:80X),
HEADER2=(1:'SNO',5:'PAGE',9:'CUS-NAME ', 20:'DOL$1', 32:'DOL$2',44:'DOL$3'),
SECTIONS=(1,5,
IFTHEN=(WHEN=(1,2,CH,EQ,C'99'),BUILD=(9:'ABC')),
IFTHEN=(WHEN=(1,2,CH,EQ,C'97'),BUILD=(9:'XYZ')),
TRAILER3=(1:1,5,20:TOT=(8,12,SFF,EDIT=(SIIIIIIIT.TT),SIGNS=(,-)),
32:TOT=(21,12,SFF,EDIT=(SIIIIIIIT.TT),SIGNS=(,-)),
44:TOT=(34,12,SFF,EDIT=(SIIIIIIIT.TT),SIGNS=(,-))))


The SORT is working fine before I added IFTHEN statements. Please advise how can I populate the CUS-NAME based on the SNO value.


1) Please, align your sample(s) of code, for other people (and you, too) would be able at least to read it!!!!


2) RTFM!

SECTIONS=(…) cannot include any IFTHEN= sub-parameter!
It is as clear as the sunny sky.

Nothing to discuss so far.
icon_kidra.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts report on job scheduling details in Zeke IBM Tools 2
No new posts Print report for each record from mul... CA Products 1
This topic is locked: you cannot edit posts or make replies. Sort card help to prepare status report DFSORT/ICETOOL 13
No new posts SARBCH REPORT DD writing error CA Products 1
No new posts Unload Report in ARCHIVE from CA-Disp... CA Products 0
Search our Forums:

Back to Top