|
View previous topic :: View next topic
|
| Author |
Message |
andreateh
New User
Joined: 31 Aug 2005 Posts: 3 Location: Malaysia
|
|
|
|
Hi!
I'm trying to separate out records in a file into two data sets based on the values in a PIC S9(9)V99 COMP-3 field starting in position 107. In the first data set, I want records with values in the field that are greater than or equal to 250. In the second data set, I want records with values in the field that are less than 250. However it seems that everything in my input file goes into the first file (OUT1) without being sorted and second file remains empty.
I've referred to
http://www-03.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/srtmacfm.html
Is there anything wrong with my JCL coding? Any solution?
Thanks!
Here's my input file layout beginning from position 107-112
.....*
000105
00057C
-----
....?*
000145
00002C
-----
......
000200
00000C
-----
... ..
000400
00000C
-----
......
000300
00000C
......
000300
00000C
-----
......
000030
00083C
-----
.....%
000236
00010C
-----
....?.
000183
00030C
-----
....?<
000274
00063C
-----
Here's my JCL:
//ESISORT EXEC SORT,PARM='SIZE=MAX'
//SORTIN DD DSN=SMN041.TESTS.CMTPCHRG.ESI.SORT,DISP=SHR
//OUT1 DD DSN=SMN041.TESTS.SORTED.ESI1,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=650,BUFNO=10)
//OUT2 DD DSN=SMN041.TESTS.SORTED.ESI2,
// DISP=(NEW,CATLG,DELETE),UNIT=DISK,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=650,BUFNO=10)
//SORTWK01 DD UNIT=DISK,SPACE=(CYL,(1,1))
//SORTWK02 DD UNIT=DISK,SPACE=(CYL,(1,1))
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,
INCLUDE=(107,6,PD,GE,+250)
OUTFIL FNAMES=OUT2,
INCLUDE=(107,6,PD,LT,+250) |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
PIC S9(9)V99 COMP-3 represents a 6-byte PD value with an implied decimal point before the last two digits. So, for example, your input value of X'00010500057C' is actually 000000104.25. Your constant of +250 is actually interpreted as +2.50. You should be using a constant of +25000 which will be interpreted as +250.00. So your OUTFIL statements should be:
| Code: |
OUTFIL FNAMES=OUT1,
INCLUDE=(107,6,PD,GE,+25000)
OUTFIL FNAMES=OUT2,
INCLUDE=(107,6,PD,LT,+25000)
|
Note that you could replace the second OUTFIL statement with:
| Code: |
OUTFIL FNAMES=OUT2,SAVE
|
|
|
| Back to top |
|
 |
andreateh
New User
Joined: 31 Aug 2005 Posts: 3 Location: Malaysia
|
|
|
|
Hi Frank!
Thanks for your prompt reply. Your first recommendation worked perfectly.
You also recommended that I can replace the second OUTFIL statement as
OUTFIL FNAMES=OUT2,SAVE
However I received the msg below when trying:
1 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0
OPTION COPY
OUTFIL FNAMES=OUT1,
INCLUDE=(107,6,PD,GE,+25000)
OUTFIL FNAMES=OUT2,SAVE
0 RECORD TYPE IS F - DATA STARTS IN POSITION 1
0 NO LENGTH OPERAND
0 SORTIN NOT DEFINED
3 END OF DFSORT
What does SAVE imply?
Thanks! |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| SAVE is just a way to say give me the records for this OUTFIL that were not included by any other OUTFIL. The messages you show have nothing to do with SAVE. They indicate that you didn't have a //SORTIN DD statement for that run. Take a look at your JCL to confirm. |
|
| Back to top |
|
 |
andreateh
New User
Joined: 31 Aug 2005 Posts: 3 Location: Malaysia
|
|
|
|
Hi Frank!
Yes, you are right. Thanks for correcting me. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|