|
View previous topic :: View next topic
|
| Author |
Message |
rohanthengal
Active User
.jpg)
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
in my sort card, i am using outrec with outfil.
| Code: |
OUTREC=(X:Y,L)
X = refers to the starting position of output field
Y = refers to the starting position of the corresponding input field |
but i am confused about L : is this the length of the input field or output field ?
as in input file if some field like NAME which starts from 10th position and length 12 whereas same field starts at 15th position in the output field but layout shows it has max length of 8 bytes.
then shall i write the outrec as
| Code: |
| OUTREC=(15:10,12) OR OUTREC=(15:10,8) |
Also what in case if i want to put spaces or zeros at BRANCH-NO field having S9(9) COMP-3 starting at 10th position & length 5 bytes in the output file ?
shall i write
? |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| L : is this the length of the input field or output field ? |
Yes.
L refers to the input length but for X:Y,L it will also be used as the output length, so if you want a different output length then the input length, you need to truncate or pad accordingly. For something like X:Y,L,F,TO=ZD,LENGTH=N, L is the input length and N is the output length.
| Quote: |
as in input file if some field like NAME which starts from 10th position and length 12 whereas same field starts at 15th position in the output field but layout shows it has max length of 8 bytes.
|
will put input positions 10-21 in output positions 15-26.
will put input positions 10-17 in output positions 15-22.
10:5X would give you spaces in output positions 10-14.
10:5Z would give you binary zeros in output positions 10-14.
10:X'000000000C' would give you a PD 0 in positions 10-14
10:+0,TO=PD,LENGTH=5 would also give you a PD 0 in positions 10-14. |
|
| Back to top |
|
 |
rohanthengal
Active User
.jpg)
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
Hi Frank,
Thanks for the info.
I tried to truncate the input using outrec but its not working.
i have DOB at 105th position in input file in 9(08) and corresponding output field is at 41st position and type S9(09) COMP-3,
I tried the below ways but it gives me syntax error:
| Code: |
1. 41:105,8,F,TO=PD,LENGTH=5
2. 41:105,TO=PD,LENGTH=5
3. 41:105,8,TO=PD,LENGTH=5 |
but none of the above worked for me
Can you please guide me over this if i am going wrong somewhere ? |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Can you show your whole OUTREC card and the output messages with the error? |
|
| Back to top |
|
 |
rohanthengal
Active User
.jpg)
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
| Code: |
INREC OVERLAY=(601:DATENS=(MD4),601,8,ZD,PD,LENGTH=5)
SORT FIELDS=COPY
OMIT COND=(1,3,CH,EQ,C'HDR',OR,1,3,CH,EQ,C'TLR')
OUTFIL FNAMES=SORTOF01,REMOVECC,
HEADER1=(1:4X,5:5X,10:609,5,15:3X,18:609,5,23:'HDR',26:10X,36:365X),
OUTREC=(1:1,4,5:5,5,10:5X,15:3X,18:10X,28:12,4,32:X,33:10,2,35:X,
36:5X,41:+0,TO=PD,LENGTH=5,46:445,8,TO=PD,LENGTH=7,53:348X),
£ |
Temporarily i have kept zeros at 41st position in the output file for length zeros, now similar problem occured while copying from 445th position [S9(13)V99 COMP-3] into the 46th position in the output having S9(13) COMP-3.
Help needs in both the scenarios:
1. copying from 9(8) to S9(9) COMP-3 field
2. copying from S9(13)V99 COMP-3 to S9(13) COMP-3.
[/code] |
|
| Back to top |
|
 |
rohanthengal
Active User
.jpg)
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
| Is this info enough Bill ? |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
OK. In the example Frank used, a literal became a packed decimal. Now you want "something" to become packed decimal, but DFSORT needs to know what the "something" is to start with, and if it is numbers, presumably it is Zoned Decimal.
If you try
| Code: |
| 41:105,8,ZD,TO=PD,LENGTH=5 |
then DFSORT will know what it is turning into a packed field, so it will be able to do it. |
|
| Back to top |
|
 |
rohanthengal
Active User
.jpg)
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
thanks Frank ...
Let me correct my syntax ..
and what about
| Code: |
| copying from S9(13)V99 COMP-3 to S9(13) COMP-3 |
?
SHall i try something like this
| Code: |
| 41:105,8,PD,LENGTH=7 |
OR anything else ? |
|
| Back to top |
|
 |
rohanthengal
Active User
.jpg)
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
Thanks Bill n Frank...
Above solution is working fine...
Now need help for
| Code: |
| copying from S9(13)V99 COMP-3 to S9(13) COMP-3 |
? |
|
| Back to top |
|
 |
rohanthengal
Active User
.jpg)
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
As per above suggestions:
i tried below formatting
| Code: |
| 46:445,8,PD,TO=PD,LENGTH=7 |
And it worked... thanks both of you and thanks IBMMAINFRAMES !!! |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Have you checked your figures? I think what you sort card will have done is retain the decimal places and truncate at the left.
If you want to get rid of decimals, division works. To get rid of two decimals, divide by +100. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|