Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Any SYNCSORT Suggestions?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Any SYNCSORT Suggestions?
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 16, 2007 9:42 pm    Post subject:
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    Post subject: Any SYNCSORT Suggestions?
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    Post subject:
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    Post subject:
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    Post subject: Re: Any SYNCSORT Suggestions?
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us