Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Comparing fields within the same record in DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
debajeet.chanda

New User


Joined: 13 Dec 2006
Posts: 2
Location: India

PostPosted: Fri May 16, 2008 9:42 pm    Post subject: Comparing fields within the same record in DFSORT
Reply with quote

I have a situation here:

I have to extract records from a file using DFSORT. The extraction criteria requires me to compare two fields on a record and then extract that record if the the extraction criteria is met.

For example, lets say my extrcation criteria states that if A < B then extract this record.

The format of these fields A and B are PIC 9(10)V99.

How can this be achieved using DFSORT?
Back to top
View user's profile Send private message
References
PostPosted: Fri May 16, 2008 9:42 pm    Post subject: Re: Comparing fields within the same record in DFSORT Reply with quote

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 983
Location: Virginia, USA

PostPosted: Fri May 16, 2008 10:01 pm    Post subject:
Reply with quote

What is the format of the input file (fixed or variable) and the record size? What are the locations of A & B, are they zoned decimal or packed decimal?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri May 16, 2008 10:19 pm    Post subject:
Reply with quote

PIC 9(10)V99 is a 12-byte ZD field. Let's assume that field A starts in position 11 and field B starts in position 31. Then the DFSORT control statements would be:

Code:

    OPTION COPY
    INCLUDE COND=(11,12,ZD,LT,31,12,ZD)


Adjust the positions as needed.

In the future, please post DFSORT questions in the DFSORT Forum.
Back to top
View user's profile Send private message
Moved: Fri May 16, 2008 10:20 pm by Frank Yaeger From JCL to DFSORT/ICETOOL
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1