View previous topic :: View next topic
Author
Message
cdelaf32 New User Joined: 22 Apr 2016Posts: 4 Location: United States
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
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
Do you mind pasting your SYSOUT message as well?
Back to top
cdelaf32 New User Joined: 22 Apr 2016Posts: 4 Location: United States
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
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10872 Location: italy
the code tags force a fixed pitch font making easier to read sources/jcl/data
with the code tags
without
" 1234567890"
Back to top
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
What you are trying to do is not correct, You would need a two step/Pass solution to achieve this
Back to top
cdelaf32 New User Joined: 22 Apr 2016Posts: 4 Location: United States
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
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
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
cdelaf32 New User Joined: 22 Apr 2016Posts: 4 Location: United States
I was hoping to achieve this in a single executing if at all possible.
Back to top
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
You could still achieve it through SYNCTOOL but it will be a two pass solution
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2011 Location: USA
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
Please enable JavaScript!