View previous topic :: View next topic
|
Author |
Message |
raja1128
New User
Joined: 09 Jan 2007 Posts: 17 Location: india
|
|
|
|
hi all,
I need to expand a file by two bytes.
here are the details...
file is fixed block with length 36.
fileld type is PIC S9(04) COMP
field starts at byte 21.
I have to make the field to PIC S9(08) COMP and retain the value.
kindly give me the sort card for this...and manual too
thanks in advance.. |
|
Back to top |
|
|
raja1128
New User
Joined: 09 Jan 2007 Posts: 17 Location: india
|
|
|
|
is there a way with DFSORT for the same??
thanks... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Your Subject says "using Syncsort" so why are you asking for a DFSORT solution? Which product are you using.
PIC S9(04) is a 2-byte value. PIC S9(08) is a 4-byte value. If the values are unsigned (e.g. X'FFFF' = 65535), then you'd just need to insert X'0000' on the left. If the values are signed (e.g. X'FFFF' = -1), then you'd have to insert X'0000' on the left for positive values or X'FFFF' on the left for negative values. So you need to indicate whether the values are unsigned or signed.
Either way, you need to insert 2 bytes, so you can either overlay the two bytes after the field, or move the bytes after the field to the right. Which do you want to do?
In the simplest case, if the values are unsigned and you just want to insert X'0000' before the field and increase the record length, you can use these DFSORT control statements:
Code: |
OPTION COPY
INREC BUILD=(1,20,2X'00',21,16)
|
The DFSORT books are available at:
Use [URL] BBCode for External Links
But if you're using Syncsort, you'll need to get the books from Syncsort. |
|
Back to top |
|
|
raja1128
New User
Joined: 09 Jan 2007 Posts: 17 Location: india
|
|
|
|
thanks frank...
I figured it out. it is a positive field and inserted x'0000' (low values) on the left. actually inserting 2Z ( binary zeoes ) also does the same.
I have both syncsort and dfsort and am using syncsort.
here is the card i used...
SORT FIELDS=COPY
OUTFIL FILES=01,
OUTREC FIELDS=(1,20,X'0000',21,16)
thansk again...have a nice weekend. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Hmmm ... seems like I figured it out.
2Z, 2X'00' and X'0000' are all equivalent. Your choice.
You could use INREC, OUTREC or OUTFIL for this. Your choice.
In the future, since you have both products, please indicate which one you want the solution for and post in the appropriate Forum accordingly. |
|
Back to top |
|
|
|