Reformatting fields in output file using DFSORT



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

Reformatting fields in output file using DFSORT

Postby hvats83 » Fri Mar 15, 2013 7:33 pm

Hi

I am having an input file of size 100 bytes and input records are as follows-
1.First 48 bytes in input file are aplhanumeric
2.Then a price field defined as PIC S9(12)V9(6) COMP-3.
3. then quantity field defined as PIC S9(12)V9(6) COMP-3.
4.Then settlement date defined as PIC X(8)
5. Then filler PIC X(5)
6. Then Account code as PIC X(5).

I am trying to create an output file in which all fileds are in displayable formt not COMP-3 field.

Sort card is as follows-
SORT FIELDS=COPY
OUTREC FIELDS=(1,48,49,10,PD,EDIT=(TTTTTTTTTTTT.TTTTTT),59,10,PD,EDIT=(TTTTTTTTTTTT.TTTTTT),68,32)

The problem I am facing is price field is zero in input file for all records.But after running sort job, all the fileds are populated correctly except price filed in which I am getting junk value as 020202020202.020202
Please suggest me how to resolve this issue.
hvats83
 
Posts: 18
Joined: Mon Dec 05, 2011 11:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Reformatting fields in output file using DFSORT

 

Re: Reformatting fields in output file using DFSORT

Postby BillyBoyo » Fri Mar 15, 2013 7:40 pm

Can you post a few records from the file, with HEX ON in your BROWSE, please? Say from column 30 to 70.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Reformatting fields in output file using DFSORT

Postby hvats83 » Fri Mar 15, 2013 7:49 pm

00 00 00 00 00 20 00 00 00 0C
00 00 00 00 00 21 00 00 00 0C
00 00 00 00 00 10 00 00 00 0C
00 00 00 00 00 16 00 00 00 0C

All these records represent comp-3 fields in input file (i.e. price and quantity)
hvats83
 
Posts: 18
Joined: Mon Dec 05, 2011 11:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Reformatting fields in output file using DFSORT

Postby BillyBoyo » Fri Mar 15, 2013 10:28 pm

Well, where are the "zeros"?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Reformatting fields in output file using DFSORT

Postby skolusu » Sat Mar 16, 2013 1:02 am

hvats83,

What is the RECFM of the file? Fixed Block (FB ) or Variable Block(VB) ? If it is VB then you need to add 4 to the position of price and quantity to account the RDW.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Reformatting fields in output file using DFSORT

Postby hvats83 » Mon Mar 18, 2013 9:29 am

BillyBoyo wrote:Well, where are the "zeros"?


price field quantity field
00 00 00 00 00 20 00 00 00 0C
00 00 00 00 00 21 00 00 00 0C
00 00 00 00 00 10 00 00 00 0C
00 00 00 00 00 16 00 00 00 0C

all price field are zero in input file
hvats83
 
Posts: 18
Joined: Mon Dec 05, 2011 11:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Reformatting fields in output file using DFSORT

Postby hvats83 » Mon Mar 18, 2013 9:30 am

skolusu wrote:hvats83,

What is the RECFM of the file? Fixed Block (FB ) or Variable Block(VB) ? If it is VB then you need to add 4 to the position of price and quantity to account the RDW.


RECFM of file is FIXED block with record size = 100 bytes
hvats83
 
Posts: 18
Joined: Mon Dec 05, 2011 11:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Reformatting fields in output file using DFSORT

Postby skolusu » Mon Mar 18, 2013 11:19 pm

hvats83 wrote:
skolusu wrote:hvats83,

What is the RECFM of the file? Fixed Block (FB ) or Variable Block(VB) ? If it is VB then you need to add 4 to the position of price and quantity to account the RDW.


RECFM of file is FIXED block with record size = 100 bytes



well if your input is indeed FB, then the data you show as input is incorrect. You said everything is zero but the are values in between. How do you explain that?
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Reformatting fields in output file using DFSORT

Postby hvats83 » Tue Mar 19, 2013 8:52 am

skolusu wrote:
hvats83 wrote:
skolusu wrote:hvats83,

What is the RECFM of the file? Fixed Block (FB ) or Variable Block(VB) ? If it is VB then you need to add 4 to the position of price and quantity to account the RDW.


RECFM of file is FIXED block with record size = 100 bytes



well if your input is indeed FB, then the data you show as input is incorrect. You said everything is zero but the are values in between. How do you explain that?


Input file is FB filw with record length = 100 bytes.
There are two comp-3 fields in the record -
1.Price field definded as S9(12)V9(6) COMP-3 and it starts from 49th position
2.Quantity field definded as S9(12)V9(6) COMP-3 and it starts from 59th position

The price field is zero for every record in input file.
Problem I am facing is - while converting price field from comp-3 to display format I am getting 020202020202.020202 in output file.Since all price fields are zeros in input file , output file should have 000000000000.000000 in price field column
hvats83
 
Posts: 18
Joined: Mon Dec 05, 2011 11:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Reformatting fields in output file using DFSORT

Postby NicC » Tue Mar 19, 2013 12:53 pm

How, and where, are you doing your current conversion beacae those 202020s look like ASCII spaces to me and therefore not on the mainframe.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post