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
 

 

Include condition in a VB file for SORT operation

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

New User


Joined: 03 Feb 2006
Posts: 41
Location: Hyderabad

PostPosted: Tue Sep 18, 2007 1:59 pm    Post subject: Include condition in a VB file for SORT operation
Reply with quote

Hi,
While specifying the Include condition for a SORT operation, I want to include only those records for which the last 3 bytes have the value 'CAN', sample records are as below

2007-07-25 Vijay K S Main Street USA
2006-05-06 Narendra M J East Coast CAN
2004-10-12 Arun A K Park Avenue Main Street CAN
2001-05-09 Sam R New Street USA

Since the records are of variable length, how to make sure that only the last 3 bytes are validated for the value 'CAN' for every record?

Thanks,
Amith
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Sep 18, 2007 2:12 pm    Post subject:
Reply with quote

Amith,

You could use format 'SS' to search for a string in the entire record. Search dfsort forum for format SS examples.
Back to top
View user's profile Send private message
kalyanp_80

New User


Joined: 03 Feb 2006
Posts: 41
Location: Hyderabad

PostPosted: Tue Sep 18, 2007 2:45 pm    Post subject:
Reply with quote

Hi Murali,

Thanks for your reply. I will try this option.

Thanks
Amith
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 18, 2007 9:19 pm    Post subject:
Reply with quote

Hello,

Quote:
I will try this option
When you do your testing, i'd suggest using at least one test record that has CAN embedded in the data as well as records with CAN at the end.

I believe any "CAN" will be a "hit", not only in the last 3 bytes.
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 Sep 18, 2007 9:44 pm    Post subject:
Reply with quote

Dick,

Quote:
I believe any "CAN" will be a "hit", not only in the last 3 bytes.


Yes, that would be true with SS.

Quote:
When you do your testing, i'd suggest using at least one test record that has CAN embedded in the data as well as records with CAN at the end.


I thought of that and was going to suggest a more foolproof way to do it, but then it occurred to me looking at the data that CAN in uppercase would probably only appear as the last field. So I didn't bother.

Amith,

If CAN can only appear at the end of the record, then these DFSORT control statements would work. I assumed the maximum record length is 80, but the INCLUDE statement can be changed appropriately for a different maximum record length.

Code:

  OPTION COPY,VLSCMP               
  INCLUDE COND=(1,80,SS,EQ,C'CAN') 


If CAN can appear elsewhere, then tell me the maximum record length in the input file and I'll show you how to ensure that CAN is only found in the last three bytes.
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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
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


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