View previous topic :: View next topic
|
Author |
Message |
maxsubrat
Active User
Joined: 27 Feb 2008 Posts: 110 Location: india
|
|
|
|
Hello,
I have a sequential file and i want to move the value of the 10th column to the 11th column. Then the 10th column should fill in spaces.
for exp:
Before change:
Code: |
FIELD10 FIELD11
3456 8786
8970 9999
6789 3434 |
After change:
Code: |
FIELD10 FIELD11
3456
8970
6789 |
"Code'd"
If it is possible to fix this thru DF SORT, please someone can answer.
Thanks |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Yes, but you need to tell me the starting position and length of the "10th column", the starting position and length of the "11th column", and the RECFM and LRECL of the input file. |
|
Back to top |
|
|
maxsubrat
Active User
Joined: 27 Feb 2008 Posts: 110 Location: india
|
|
|
|
Starting position of the 10th column = 24 and Length = 4
Starting position of the 11th column = 28 and Length = 4
RECFM = F and LRECL = 46 in the input file
Thanks |
|
Back to top |
|
|
ssmukul
New User
Joined: 22 Jan 2008 Posts: 19 Location: India
|
|
|
|
Hi,
Below sort card should work. Please try.
Code: |
SORT FIELDS=COPY
OUTREC BUILD=(1,23,4X,28:24,4,32,15) |
Thanks, |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
ssmukul wrote: |
Below sort card should work. Please try. |
What will happen to the rest of the 'columns'? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Below sort card should work. Please try. |
You should test "solutions" before posting them to make sure the result meets the requirement. . . |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
CICS Guy and dick scherrer,
What makes you think that ssmukul's control cards will NOT work? As per OP's latest request the output file will be 46 bytes and ssmukul did account for the right positions and length.
maxsubrat wrote: |
Starting position of the 10th column = 24 and Length = 4
Starting position of the 11th column = 28 and Length = 4
RECFM = F and LRECL = 46 in the input file
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Kolusu,
I was responding to the "should work". I probably should have been more clear - i didn't mean to say/imply it would not work
Quote: |
Below sort card should work. Please try. |
What i meant to convey was that (for the most part - there's always an exception or 2), solutions need to be tested/verified before posting. Preferably showing the output gotten from the sample input. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Hi Kolusu,
As usual, I sometimes miss the obvious (1,23) and was thinking in terms of OVERLAY rather than just BUILD.... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Note that this could be done with OVERLAY as well like this:
Code: |
OPTION COPY
INREC OVERLAY=(28:24,4,24:4X)
|
|
|
Back to top |
|
|
ssmukul
New User
Joined: 22 Jan 2008 Posts: 19 Location: India
|
|
|
|
Hi Dick,
I had tested the SORT card before posting. But sorry to write "should work". I will keep this in mind for future posts.
Thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi ssmukul,
Thanks for the follow-up
I often forget that "should" often means "does" here at the forum. . .
d |
|
Back to top |
|
|
|