IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Include condition in a VB file for SORT operation


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

PostPosted: Tue Sep 18, 2007 2:12 pm
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
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

Moderator Emeritus


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

PostPosted: Tue Sep 18, 2007 9:19 pm
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 Developer


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

PostPosted: Tue Sep 18, 2007 9:44 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top