convert CH to PD format



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

convert CH to PD format

Postby Kiran Franics » Thu Aug 09, 2012 12:11 pm

Hi,

I need to convert a character field(Contains numeric data) to PD format.


input file declared as below:-

PREM(Position 28:44)     PIC -(13)9.99.
RATE(Position 47:53)     PIC -(3)9.99.



Input file have below record:-

----+----1----+----2----+----3----+----4----+----5---
***************************** Top of Data ***********
NH51418241IDBI014E 20200525            18.17YM   2.98
**************************** Bottom of Data *********


In the Sort card, I have mentioned as below:-

//SYSIN    DD *                               
 OPTION COPY                                   
 OUTREC OVERLAY=(28:28,14,SFF,TO=PD,LENGTH=14,
                 43:43,2,SFF,TO=PD,LENGTH=2)   
/*                                             


I got this output and it is not correct format.

NH51418241IDBI014E 20200525  a@YM  ð         
DCFFFFFFFFCCCCFFFC4FFFFFFFF00000000000000087ED0000028         
5851418241942901450202005250000000000000011F84000009F         



My expected output should be as below:-

NH51418241IDBI014E 20200525  a@YM  ð             
DCFFFFFFFFCCCCFFFC4FFFFFFFF00000087ED028
5851418241942901450202005250000011C8409C



Can you please help me solve this pblm?

Thanks
Kiran Franics
 
Posts: 4
Joined: Thu Aug 09, 2012 11:42 am
Has thanked: 0 time
Been thanked: 0 time

Re: convert CH to PD format

Postby BillyBoyo » Thu Aug 09, 2012 12:39 pm

A PD is much "smaller" than a character field. Try with TO=8 and 4.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: convert CH to PD format

Postby Kiran Franics » Thu Aug 09, 2012 1:58 pm

Thanks BillyBoyo, it is working as expected..
Kiran Franics
 
Posts: 4
Joined: Thu Aug 09, 2012 11:42 am
Has thanked: 0 time
Been thanked: 0 time

Re: convert CH to PD format

Postby BillyBoyo » Thu Aug 09, 2012 2:44 pm

Now that your post is Code'd, I'm wondering if you would be better off with BUILD for this situation, rather than OVERLAY. Your example shows the output record being shorter, which OVERLAY is not going to do. You also seem to have a binary field in between the two numerics, which isn't dealt with in your sort card.

Was this just an example extracted from something bigger? Are you OK with the whole thing now?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: convert CH to PD format

Postby Kiran Franics » Fri Aug 17, 2012 1:19 pm

Sorry BillyBoyo... Just now I saw ur post....

Above details are just an example and I need to convert huge data with so many fields.. Now I am doing the testing and everything looks fine.

Once again thanks for your help....
Kiran Franics
 
Posts: 4
Joined: Thu Aug 09, 2012 11:42 am
Has thanked: 0 time
Been thanked: 0 time

Re: convert CH to PD format

Postby BillyBoyo » Fri Aug 17, 2012 1:50 pm

Thanks for letting us know. If you have questions, there'll be someone here.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: convert CH to PD format

Postby dick scherrer » Fri Aug 17, 2012 7:57 pm

Hello,

If this is working as you want, great, but the "actual" output and the "expected" output posted are not consistent between the "characters" and the "hex".

At this point, it may not matter . . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: convert CH to PD format

Postby BillyBoyo » Sat Aug 18, 2012 1:24 pm

Kiran, have a look at what Dick has said. You "sign" (the righ-most four bits of the packed-decimal field) is different from desired to achieved. This can be important, but might not matter at all. If you have lots of fields. best to get it sorted out early. Review format PD's "cousins".
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post