Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : programming pearls - The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand.

Google
 
Web mainframegurukul.com

Welcome to the mainframegurukul forums.

You are currently viewing our mainframe forums as a guest which gives you limited access to view most discussions, articles. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support at admin@mainframegurukul.com


SYNCSORT to Add Fields and Create Summary Records

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
rcticejr
Member


Joined: 19 Jan 2007
Posts: 2

PostPosted: Fri Jan 19, 2007 8:27 am    Post subject: SYNCSORT to Add Fields and Create Summary Records Reply with quote

Question
I have an analyst on my team that is trying to use syncsort to sum the values from 3 data columns from a file, then add them to create a summary level record when a control break is reached (dealer, part or model changes). Here's a simplified version of the file layout:
dealer
part
model
demand1
demand2
demand3

Add demand 1, 2 and 3 for each line. Add the sum into a summary record that is created for each unique dealer-part-model combination.

Is this possible with syncsort or will it require several syncsoft steps (add columns in 1 step, sum into summary record in a second step)?
Back to top
View user's profile Send private message

Veera
Moderator


Joined: 22 Feb 2006
Posts: 111

PostPosted: Sat Jan 20, 2007 6:55 am    Post subject: JCL to Add Fields and Create Summary Records Reply with quote

Hi rcticejr,

Its possible with ICETOOL,

First let me give my understanding of your requirement and the way i coded based on it,if my understanding is wrong please correct me.

Say we have a input FILEA with the following records

FILEA -> RECS

dealer part model demand1 demand2 demand3
D1 P1 M1 15 15 15
D1 P1 M1 14 14 14
D2 P2 M2 15 15 15
D2 P2 M2 14 14 14

Final Output Desired as per your requirement
********************************************

dealer part model Sum(demand1+ demand2+ demand3) per each key
D1 P1 M1 87
D2 P2 M2 87

Find below the JCL

//TESTSUMX JOB (AAAA,04,T,0000),'SORTT',CLASS=C,MSGCLASS=T,
// NOTIFY=AAAA

/*JOBPARM L=9999
//*
//JOBLIB DD DSN=AAAA.LOAD,DISP=SHR
//*
//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//*
//IN1 DD *
D1 P1 M1 15 15 15
D1 P1 M1 14 14 14
D2 P2 M2 15 15 15
D2 P2 M2 14 14 14
//*
//TMP1 DD DSN=AAAA.TEST.TMP1,
// DISP=(MOD,PASS),
// UNIT=SYSDA,
// SPACE=(CYL,(1,2),RLSE),
// DCB=(RECFM=FB,LRECL=11,BLKSIZE=110)
//*
//OUT DD DSN=AAAA.TEST.SPLOUTF,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(1,2),RLSE),
// DCB=(RECFM=FB,LRECL=11,BLKSIZE=110)
//*
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1) USING(CPY1)
SORT FROM(TMP1) TO(OUT) USING(CPY2)
//CPY1CNTL DD *
OUTFIL FNAMES=TMP1,
BUILD=(1,9,(10,2,ZD,ADD,13,2,ZD,ADD,16,2,ZD),EDIT=(TT),SIGNS=(+,-))
//CPY2CNTL DD *
SORT FIELDS=(1,9,CH,A)
SUM FIELDS=(10,2,CH)

Thanks
Veera.
Back to top
View user's profile Send private message
rcticejr
Member


Joined: 19 Jan 2007
Posts: 2

PostPosted: Sat Jan 20, 2007 7:56 am    Post subject: This might help us! Reply with quote

Veera,
Interesting, I have not tried ICETOOL in the past, but this looks like it may be something that could achieve our goal. Thank you for your suggestion!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Two outputs created as a result of generation of a map 2 Krishna 1504 Mon Jul 12, 2010 5:20 pm
tony_prabu View latest post
No new posts Trying to delete/define a VSAm, but VSAM is in use 10 Dr_Halo 1842 Sat Mar 21, 2009 8:14 am
Anuj Dhawan View latest post
No new posts Hi while trying to copy a flat file to KSDS VSAM file , an e 1 SUBARNA ROY 3831 Sat Jun 21, 2008 2:29 pm
MikeJ024 View latest post
No new posts difference between COMP and COMP-3 2 pkaushi 10209 Mon Aug 14, 2006 4:22 pm
ravi View latest post
No new posts comp and comp3 1 padmapriya7 6906 Mon Feb 06, 2006 12:27 am
prasad View latest post
 



This widget requires Flash Player 9 or better








Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB