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
 

 

Error in using INCLUDE with SORT

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

New User


Joined: 19 Feb 2005
Posts: 25
Location: chennai

PostPosted: Fri Aug 05, 2005 10:27 am    Post subject: Error in using INCLUDE with SORT
Reply with quote

Iam getting error when i try to include only certain records & then sort.My code is as follows:

Code:

//job1 job (NI80),'XXX',CLASS=A,MSGCLASS=X       
//STEP EXEC PGM=SORT                                               
//SORTIN DD DSN=abc.TRG.STU,DISP=SHR                           
//SORTOUT DD DSN=abc.TRG.SORTED,DISP=SHR                       
//SYSOUT DD SYSOUT=*                                               
//SYSIN DD *                                                       
  INCLUDE COND=(21,2,BI,GE,22)                                     
  SORT FIELDS=(3,18,CH,A,21,2,BI,D)                                 
/*                                                                 
//* SORTING COMPLETE                                               
//       


My input file is likethis:

Code:

04HARISH            22
14HARISH            32
24HARISH            28
07KADHIR            25
20THANUJA           24


My age field starts from 21st column.I want to include all records with age >=22.
But iam getting abend for the above code.
Iam able to include alphanumeric fields & sort.
Please help me out.
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri Aug 05, 2005 10:58 am    Post subject: Re: Error in using INCLUDE with SORT
Reply with quote

Hi logaas,

Change your code as per below.....

Code:
//SYSIN DD *
  INCLUDE COND=(21,2,BI,GE,C'22')
  SORT FIELDS=(3,18,CH,A,21,2,BI,D)
/*


Regards,

Priyesh.
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: Fri Aug 05, 2005 7:58 pm    Post subject:
Reply with quote

Or alternatively:

Code:

//SYSIN DD *
  INCLUDE COND=(21,2,ZD,GE,22)
  SORT FIELDS=(3,18,CH,A,21,2,BI,D)
/*


If you compare a BI value to a decimal number (22), the BI value is interpreted as a binary number, so a value of '22' in the record is interpreted as its binary value of X'F2F2' = 62194. If you compare a BI value to a character constant ('22'), the BI value is interpreted as a character value, so a value of '22' in the record is interpreted as '22'. Thus 21,2,BI,GE,22 will not do what you want, but 21,2,BI,GE,C'22' will.

Alternatively you can treat the '22' as a ZD value of 22 and compare it to a decimal constant of 22, so 21,2,ZD,GE,22 will do what you want.
Note that using CH works fine as long as the numbers in the record use F as the sign. ZD works regardless of what's used as the sign (e.g. F, C or D).
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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