Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us