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
 

 

Sorting Out Comp-3 fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
andreateh

New User


Joined: 31 Aug 2005
Posts: 3
Location: Malaysia

PostPosted: Tue Nov 15, 2005 4:45 pm    Post subject: Sorting Out Comp-3 fields
Reply with quote

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
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Nov 15, 2005 10:21 pm    Post subject:
Reply with quote

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
View user's profile Send private message
andreateh

New User


Joined: 31 Aug 2005
Posts: 3
Location: Malaysia

PostPosted: Wed Nov 16, 2005 6:42 am    Post subject: Re: Sorting Out Comp-3 fields
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Nov 16, 2005 6:56 am    Post subject:
Reply with quote

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
View user's profile Send private message
andreateh

New User


Joined: 31 Aug 2005
Posts: 3
Location: Malaysia

PostPosted: Wed Nov 16, 2005 7:08 am    Post subject:
Reply with quote

Hi Frank!

Yes, you are right. Thanks for correcting me.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


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