Comparing COMP3 Variable in SORT

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
salini devana
Member
Posts: 5
Joined: Thu Jan 03, 2013 4:34 pm

Comparing COMP3 Variable in SORT

Post by salini devana » Fri Jan 11, 2013 7:24 pm

I have defined COMP-3 variable as follows.

Amount - PIC S9(11)V99 COMP-3

I need to extract the data where amount is not equal to 0.

How can i include this condition in the in SORT?

SORT = (123,8,PD,NE,0000000000000)

Is this correct? Please help me.
Salini D

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Fri Jan 11, 2013 9:00 pm

That is not correct. You need to use the syntax specified in the manual or other topics here in the forum.

You can either SORT the data or COPY the data.

Do you need to (re)sequence the data or simply extract those records?

Search for topics that use INCLUDE.
Have a good one

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Sat Jan 12, 2013 2:01 am

Or its sibling, OMIT, to avoid the confusion of a negative condition.

salini devana
Member
Posts: 5
Joined: Thu Jan 03, 2013 4:34 pm

Post by salini devana » Tue Jan 15, 2013 11:05 am

DikDude,

I need to extract the data for which amount is not equal to 0 but not resequencing.

OUTREC IFTHEN=(123,8,PD,NE,0000000000000)

Is this syntax correct? For Comp-3, shall i need to use PD (Packed decimal)?
Salini D

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Jan 15, 2013 12:56 pm

It was suggested that you look at INCLUDE/OMIT in the documentation. Did you do that?

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others