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
 

 

SUM file with secondary sorted file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
cdelaf32

New User


Joined: 22 Apr 2016
Posts: 4
Location: United States

PostPosted: Mon Apr 25, 2016 10:20 pm    Post subject: SUM file with secondary sorted file
Reply with quote

I am trying to create a summary file and a complete sorted file using a single execution. File 1 is the complete file sorted and file 2 is to be only a summary file utilizing SUM=None.
Here is my attempt, however I am getting an error on the Sum field. I am in a VSE environment.
Code:
// DLBL    SORTIN1,'DP.MA.PY440'               
// DLBL    SORTOUT,'DP.MA.PY440.SRTD'           
// EXTENT  SYS001,LCPROD,,,1,500                       
// DLBL    SORTOF2,'DP.MA.PY440.SUMX'       
// EXTENT  SYS002,LCPROD,,,1,500                       
// EXEC SORT,SIZE=(SORT,700K)                             
 SORT FIELDS=(10,5,CH,A,1,10,CH,A),                       
        FILES=1,WORK=1,FILESOUT=2                         
 RECORD TYPE=F,LENGTH=080                                 
 INPFIL BLKSIZE=800                                       
 OUTFIL FILES=1,DISK,                                     
 SUM FIELDS=NONE                                         
 OUTFIL FILES=2,DISK


code' d by a moderator
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon Apr 25, 2016 10:34 pm    Post subject:
Reply with quote

Do you mind pasting your SYSOUT message as well?
Back to top
View user's profile Send private message
cdelaf32

New User


Joined: 22 Apr 2016
Posts: 4
Location: United States

PostPosted: Mon Apr 25, 2016 10:37 pm    Post subject: Reply to: SUM file with secondary sorted file
Reply with quote

Code:
SORT FIELDS=(10,5,CH,A,1,10,CH,A)                                     
        FILES=1,WORK=1,FILESOUT=2                                     
        *                                                             
 RECORD TYPE=F,LENGTH=80                                               
 INPFIL BLKSIZE=800                                                   
 OUTFIL FILES=1,DISK,                                                 
        INCLUDE=(713,8,CH,LT,C'20111103')                             
 OUTFIL FILES=2,DISK,                                                 
        SUM FIELDS=NONE                                               
        *                                                             
                                                                       
   WER100A  INVALID STATEMENT BEFORE END STMT                         
   WER047A  OUTFIL STATEMENT HAS SYNTAX ERROR                         
   WER234A  DIAG= 08000004 00000000 00000000 00000000 00070000 00000000
   WER400A  CRITICAL ERROR, SORT TERMINATED                           
   WER117A  PHASE 0 HAS CRITICAL ERROR


code' d again
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Mon Apr 25, 2016 10:48 pm    Post subject: Reply to: SUM file with secondary sorted file
Reply with quote

the code tags force a fixed pitch font making easier to read sources/jcl/data

with the code tags
Code:
"          1234567890"


without

" 1234567890"
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon Apr 25, 2016 10:57 pm    Post subject:
Reply with quote

What you are trying to do is not correct, You would need a two step/Pass solution to achieve this
Back to top
View user's profile Send private message
cdelaf32

New User


Joined: 22 Apr 2016
Posts: 4
Location: United States

PostPosted: Mon Apr 25, 2016 11:01 pm    Post subject: Reply to: SUM file with secondary sorted file
Reply with quote

I made slight variation and the execution works however I did not get expected results. here is sample data:
Code:
200090104    78778
200090110    78778
200130101    78778
200130101    78778

I would expect to get on file 1 4 records and file 2 3 records.

Code:
// DLBL    SORTIN1,'DP.MA.PY440'           
// DLBL    SORTOUT,'DP.MA.PY440.SRTD'     
// EXTENT  SYS001,LCPROD,,,1,500                 
// DLBL    SORTOF2,'DP.MA.PY440.SUMX',15   
// EXTENT  SYS002,LCPROD,,,1,500                 
// EXEC SORT,SIZE=(SORT,700K)                     
 SORT FIELDS=(10,5,CH,A,1,10,CH,A),               
      FILESOUT=2                                 
 RECORD TYPE=F,LENGTH=080                         
 INPFIL BLKSIZE=800                               
 OUTFIL FILES=1,INCLUDE=ALL,DISK                 
 OUTFIL FILES=2,DISK                             
 SUM FIELDS=NONE                                 
                                                 
   WER029I  **END PHASE 0 NO ERRORS DETECTED**   
   WER221I  B =       819                         
   WER222I  G =    150267                         
   WER228I  INSERT         0, DELETE         1   
   WER227I  RCD IN         4, OUT          3
   WER225I  *** END SORT PHASE ***                             
   WER407I  SORTOUT  :  DATA RECORDS OUT         3             
   WER408I  SORTOUT  : TOTAL RECORDS OUT         3             
   WER407I  SORTOF2  :  DATA RECORDS OUT         3             
   WER408I  SORTOF2  : TOTAL RECORDS OUT         3             
   WER226A  END SYNCSORT (SRTMULTI), RECORD=         3, INCORE 
1S55I  LAST RETURN CODE WAS 0000         
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon Apr 25, 2016 11:04 pm    Post subject:
Reply with quote

Try this:

Step 1 : Step 1 sort the file and place to output file 1
Step 2 : Step 2 sort and eliminate the duplicates to output file 2
Back to top
View user's profile Send private message
cdelaf32

New User


Joined: 22 Apr 2016
Posts: 4
Location: United States

PostPosted: Mon Apr 25, 2016 11:11 pm    Post subject: Reply to: SUM file with secondary sorted file
Reply with quote

I was hoping to achieve this in a single executing if at all possible.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon Apr 25, 2016 11:18 pm    Post subject:
Reply with quote

You could still achieve it through SYNCTOOL but it will be a two pass solution
Back to top
View user's profile Send private message
sergeyken

New User


Joined: 29 Apr 2008
Posts: 37
Location: Maryland

PostPosted: Thu Aug 11, 2016 3:19 am    Post subject:
Reply with quote

One-step sort with SYNCSORT looks like this

Code:

//SORT02   EXEC PGM=SYNCSORT     
//*                               
//SYSOUT   DD  SYSOUT=*           
//*                               
//FULLSORT DD  SYSOUT=*           
//UNIQUES  DD  SYSOUT=*           
//*                               
//SYSIN    DD  *                 
 SORT FIELDS=(11,05,CH,A,         
               1,10,CH,A)         
 OUTFIL FNAMES=FULLSORT           
 OUTFIL FNAMES=UNIQUES,           
        REMOVECC,NODETAIL,       
        SECTIONS=(11,5,           
                   1,10,         
                  HEADER3=(1,15))
 END                             
//*-+----1----+                   
//SORTIN   DD  *                 
8888888888BBBBB                   
1111111111BBBBB   
7777777777BBBBB   
2222222222BBBBB   
8888888888ZZZZZ   
1111111111ZZZZZ   
7777777777ZZZZZ   
2222222222ZZZZZ   
8888888888BBBBB   
1111111111BBBBB   
7777777777BBBBB   
2222222222BBBBB   
8888888888ZZZZZ   
1111111111ZZZZZ   
7777777777ZZZZZ   
2222222222ZZZZZ   
8888888888BBBBB   
1111111111BBBBB   
7777777777BBBBB   
2222222222BBBBB   
8888888888ZZZZZ   
1111111111ZZZZZ   
7777777777ZZZZZ   
2222222222ZZZZZ   
//*               


The result in FULLSORT:
Code:

1111111111BBBBB   
1111111111BBBBB   
1111111111BBBBB   
2222222222BBBBB   
2222222222BBBBB   
2222222222BBBBB   
7777777777BBBBB   
7777777777BBBBB   
7777777777BBBBB   
8888888888BBBBB   
8888888888BBBBB   
8888888888BBBBB   
1111111111ZZZZZ   
1111111111ZZZZZ   
1111111111ZZZZZ   
2222222222ZZZZZ   
2222222222ZZZZZ   
2222222222ZZZZZ   
7777777777ZZZZZ
7777777777ZZZZZ
7777777777ZZZZZ
8888888888ZZZZZ
8888888888ZZZZZ
8888888888ZZZZZ


The result in UNIQUES:
Code:

1111111111BBBBB
2222222222BBBBB
7777777777BBBBB
8888888888BBBBB
1111111111ZZZZZ
2222222222ZZZZZ
7777777777ZZZZZ
8888888888ZZZZZ
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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