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 

Problem with repro when one of the key is PD & has negat

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


Joined: 29 Aug 2005
Posts: 19
Topics: 7

PostPosted: Thu Dec 22, 2005 12:14 am    Post subject: Problem with repro when one of the key is PD & has negat Reply with quote

Hi

I am reporing from a flat file into a VSAM . But it is failing after writing first & fifth record. This is how my input file's key looks like

Field1(X) : Field2(PD) : Field3(PD) : Field4(PD): Field5(PD)

AB : 58 : 92 : 601 : -20050702
AB : 58 : 92 : 601 : -20050602
AB : 58 : 92 : 601 : -20050502
AB : 58 : 92 : 601 : -20050402
AB : 58 : 159 : 601 : -20050702

I am getting records out of sequence from 2nd record onwards.
Can any one help me as from the data we can see that input file is in ascending order on the key & therefore data should be reproed

Thanks
Back to top
View user's profile Send private message
Vinodch
Beginner


Joined: 23 Dec 2002
Posts: 80
Topics: 32
Location: Chennai, India

PostPosted: Thu Dec 22, 2005 12:36 am    Post subject: Reply with quote

Madisand

What is the key length of a VSAM file ?

Can you sort the flat file based on the full length of the file ?. After that

please try to repro the file.
_________________
Thanks,
Vinod.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Dec 22, 2005 12:40 am    Post subject: Reply with quote

Madisand,

Though -20050602 is greater than -20050702 from a pure numeric perspective, it turns false for Packed Decimal representation. Just open the flat file in view mode and try issuing SORT on the entire key field (field 1 to field5), you will see that Record 2 gets re-positioned before record 1.

This how the data looks like in HEX mode. Now if you look at column 12, you have the value X'70' in first record and X'60' in the second. So when you sort, the second record is moved up as all other characters remain same except column 12.
[code:1:9710689f4e]
Command ===>
****** ***************************** Top of Data ****


-----------------------------------------------------
=COLS> ----+----1----+----2----+----3----+----4----+-
----+----F----+----F----+----F----+----F----+-
----+----1----+----2----+----3----+----4----+-
-----------------------------------------------------
000001 AB
Back to top
View user's profile Send private message
madisand
Beginner


Joined: 29 Aug 2005
Posts: 19
Topics: 7

PostPosted: Thu Dec 22, 2005 1:00 am    Post subject: Reply with quote

Thanks phantom,

You have always helped in this forum.
Numerically first key is lower than second key. I want to retain the same sequence in VSAM. How do I do it. You know any method?
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Dec 22, 2005 1:08 am    Post subject: Reply with quote

Madisand,

You are welcome Exclamation

As explained by Cogito, try to convert the PD fields to pure numeric or if you want to save space then go for Binary (Comp). You can insert a SORT step before your REPRO to do this convertion and then change your program/copybook layout appropriately.

Or, you can probably sort the flat file on entire key using BI format (SORT FIELDS=(key_start, key_length, BI, A)) and then repro it to VSAM but this is not advisable as your program may not find the matching key (it happened to me !).

So, talk to your team and try to convert the fields from PD to someother format.

Thanks,
Phantom
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