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

Any SYNCSORT Suggestions?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
amirthashankar

New User


Joined: 12 Jul 2007
Posts: 1
Location: Chennai

PostPosted: Mon Jul 16, 2007 8:14 pm
Reply with quote

I have a report file of 200 bytes fixed length. The fields are as follows:

(We require these fileds (FLD 1 - 7) for sorting purpose)



Positions

FLD 1 1 - 4

FLD 2 5 - 9

FLD 3 10 17

FLD 4 18 - 22

FLD 5 23 - 27

FLD 6 28 - 32

FLD 7 33 - 37

FLD 8 38 - 41 (Line cnt in eacb page of the report)

I have shown two sample records from the file.

000500001BIGK 383104051440600031790086 TOTAL

000500002BIGK 383104051440600031790047 GRAND TOTAL



The first record is from Page 1 which has 86 lines and second record is from page 2 which has 47 lines.

(Note: All the records in the pages will have zeros in the line cnt field. Only the last record in each page will have the count value)

The requirement is I need to sum up these two line cnt values (86 + 47) and have it as below:



FLD FLD FLD FLD FLD FLD FLD FLD

1 2 3 4 5 6 7 8

000500001BIGK 383104051440600031790086 TOTAL

000500002BIGK 383104051440600031790047 GRAND TOTAL

END CNT 0133



We cannot use SUM FIELDS here because this will remove duplicate keys and will result in only 1 record. My sort keys will be fields 1 thru 7 respectively.

Please let me know if this can be achieved using any other option. My shop supports only SYNCSORT.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jul 16, 2007 9:42 pm
Reply with quote

Do not think in terms of SUM, think in terms of TOTAL (like in a report trailer).........
Back to top
View user's profile Send private message
raghunathns

Active User


Joined: 08 Dec 2005
Posts: 127
Location: rochester

PostPosted: Mon Jul 16, 2007 9:44 pm
Reply with quote

this is any alternate solution. you can do it with the program which is creating this file.(i mean syncsort input file).

that program is writing 0086, 0047. so page wise toals are accumulated in the program. when ever there is a new page then add page total to grand total. at the end of the program wire another summary line in the file.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Mon Jul 16, 2007 11:16 pm
Reply with quote

Syncsort may be generating the report, not some Cobol program.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jul 17, 2007 10:40 am
Reply with quote

amirthashankar
Here you go
Code:
//*******************************************************               
//STEP1    EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000500001BIGK 383104051440600031790086 TOTAL                           
000500002BIGK 383104051440600031790047 GRAND TOTAL                     
/*                                                                     
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
           OPTION COPY                                                 
           OUTFIL REMOVECC,                                             
           TRAILER1=(1:C'END CNT',10:TOT=(37,2,ZD,EDIT=(IIIIT)))       
/*                                                                     

SORTOUT
Code:
----+----1----+----2----+----3----+----4----+----5----+----6
000500001BIGK 383104051440600031790086 TOTAL               
000500002BIGK 383104051440600031790047 GRAND TOTAL         
END CNT    133                                             
Back to top
View user's profile Send private message
sudhakar_mainframe
Warnings : 1

New User


Joined: 29 Jun 2006
Posts: 25

PostPosted: Sat Jul 21, 2007 11:10 am
Reply with quote

Hi,
can u please elabroate the sort card

bye,
sudhakar icon_smile.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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Data Backup suggestions DB2 5
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
Search our Forums:

Back to Top