MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Handling a varible length field in SORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
srini_igsi
Beginner


Joined: 12 May 2006
Posts: 41
Topics: 16
Location: Mumbai

PostPosted: Tue Oct 02, 2007 9:56 am    Post subject: Handling a varible length field in SORT Reply with quote

I have two files FILE1 and FILE2. I have to compare both the files on a specific key. Both the files have got some common fields in them.

FILE1:
Client1
Client2
Client3
Client4
Client5

FILE2:
Client1
Client2
Client3
Client4
Client5

Primary Key in FILE1 and FILE2:
MI ID, CLENT CODE, PATIENT ID, DOB, FST NAME

Constraint: PATIENT ID is variable

Requirement: Some of the Clients may use the PATIENT ID as sub-set or Full-key of Patient ID. The info as to what would be the length to be used for a Client will be stored in one of the DB tables. So before comarision of the records in FILE1 and FILE2, we have to first refer the table for the Patient ID length to be used for comparision.

I don't see any issues from the program perpective, but the only problem is with handling the Patient ID in the SORT cards. We have to SORT all the records of all the clinets as per their desired lengths of the Patient IDs registered in the DB2 table.

Can somebody suggest me handling the Patient ID in the SORT cards which may vary in length from one Client to the other.
_________________
Thanks,
-Srini
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Tue Oct 02, 2007 12:16 pm    Post subject: Reply with quote

If the field is the same for all recs in a run, Sort has SYMBOLIC NAMES so you could generate a card defining the ID field to be fed into the SORT step. This example shows a simple sort but the symbolic name can probably be used for matching, etc.
Code:
//SYMNAMES DD *                   
LASTNAME,10,10,CH                 
//SYSIN DD *                       
 SORT FIELDS=(LASTNAME,A)           


If the field varies from record to record, maybe the SUBSTRING function could be used?
Code:
 INCLUDE COND=((19,50,SS,EQ,C'HOUSE'))  MATCH 'HOUSE' WITHIN POS 19-68


Otherwise, try to standardize the records prior to compare.

Some sample input records and your desired output might help you get specific suggestions.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
srini_igsi
Beginner


Joined: 12 May 2006
Posts: 41
Topics: 16
Location: Mumbai

PostPosted: Wed Oct 03, 2007 2:18 am    Post subject: Reply with quote

Thanks for looking into this Bill. I will get back with some sample records shortly.
_________________
Thanks,
-Srini
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group