Page 1 of 2

Reformatting fields in output file using DFSORT

PostPosted: Fri Mar 15, 2013 7:33 pm
by hvats83
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.

Re: Reformatting fields in output file using DFSORT

PostPosted: Fri Mar 15, 2013 7:40 pm
by BillyBoyo
Can you post a few records from the file, with HEX ON in your BROWSE, please? Say from column 30 to 70.

Re: Reformatting fields in output file using DFSORT

PostPosted: Fri Mar 15, 2013 7:49 pm
by hvats83
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)

Re: Reformatting fields in output file using DFSORT

PostPosted: Fri Mar 15, 2013 10:28 pm
by BillyBoyo
Well, where are the "zeros"?

Re: Reformatting fields in output file using DFSORT

PostPosted: Sat Mar 16, 2013 1:02 am
by skolusu
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.

Re: Reformatting fields in output file using DFSORT

PostPosted: Mon Mar 18, 2013 9:29 am
by hvats83
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

Re: Reformatting fields in output file using DFSORT

PostPosted: Mon Mar 18, 2013 9:30 am
by hvats83
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

Re: Reformatting fields in output file using DFSORT

PostPosted: Mon Mar 18, 2013 11:19 pm
by skolusu
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?

Re: Reformatting fields in output file using DFSORT

PostPosted: Tue Mar 19, 2013 8:52 am
by hvats83
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

Re: Reformatting fields in output file using DFSORT

PostPosted: Tue Mar 19, 2013 12:53 pm
by NicC
How, and where, are you doing your current conversion beacae those 202020s look like ASCII spaces to me and therefore not on the mainframe.