View previous topic :: View next topic
|
Author |
Message |
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
Hi,
I have a file with 1220(VB). i have to copy the data from positions and length respectively being at (4,22) and (1124,08) into the out put file
I have coded and the output like this:
[SORT FIELDS=(4,19,CH,A,1124,08,CH,A)
OUTREC FIELDS=(1,25,1128,08)
]
output:
[
13000037787611000026000228135
13000037787611000027800228135
13000037787611000091401475741
13000037787611000092201475741
]
but what i expect is
[00037787611000026000228135
00037787611000027800228135
00037787611000091401475741
]
please some one help |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
I assume that you have already considered that the VB records consist of a 4-byte RDW followed by the data.
Can you post your sample input data and expected Output data(using Code Tags).
Edited:
Also please specify if you are using Syncsort/DFSORT?? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
ram_vizag,
I know you know how to use the Code tags, so please remember to do so.
Post the full sysout, including the message numbers, please.
As mistah kurtz has noticed, your positions are wrong for a VB, but there might be other problems as well. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I'm probably missing something, but as the code has no include/omit/sum/etc processing, why is there a different number of records expected? Why is one gone from your "expected" output? |
|
Back to top |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
input data:
Code: |
130000377876112719222 1 20130207AXGGQM 00000000520160630
130000377876112719230 1 20130207AXGGQM 00000000520160731
130000377876114175183 1 20130207AXGGQV 00000000520160331
130000377876114175209 1 20130207AXGGQV 00000000520160531
130000377876199500248 1 20050923ASSSTD B020081103820101231
|
expected :
Code: |
000377876112719222
000377876112719230
000377876114175183
000377876114175209
000377876199500248
000377876401200579
|
afterthe above 19 bytes , another 8 bytes are to be written from position (1124,8)... i think u got now...record length is 1220 with Vb and need to sort (positions,length) --->(4,22) and (1124,8) |
|
Back to top |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
i need only these two fields (4,22) and( 1124,8) into outrec...please help |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Now you've got more data in the output than the input.
From your data it is unclear if it is already sorted (it looks like it is) or whether you want to SORT.
Do you want the output as a VB or FB?
Is your 2nd field with the minimum length of the VB?
It is a really simple thing, what is the problem you are having?
Where are the messages I asked for? |
|
Back to top |
|
|
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Hi Ram,
Do you want to copy data from VB file to VB file or VB file to FB file ? |
|
Back to top |
|
|
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Hi Ram,
Please find the code for VB to FB -
Code: |
//SYSIN DD *
SORT FIELDS=(4,19,CH,A,1124,08,CH,A)
OUTFIL FNAMES=SORTOUT,VTOF,
OUTREC=(08,22,1128,8,1220:X),VLFILL=C' '
//* |
for VB to VB -
Code: |
//SYSIN DD *
SORT FIELDS=(4,19,CH,A,1124,08,CH,A)
OUTFIL FNAMES=SORTOUT,VLFILL=C' ',VLTRIM=C' ',
OUTREC=(01:01,04,05:08,22,28:1128,8)
//* |
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
I'm not sure if we're a bit fast to jump to a solution; also I'm confused with the sample data posted so far. First you had less number of records in output and later you've got more data in the output than the input, as Bill has also questioned.
If this is
Quote: |
i need only these two fields (4,22) and( 1124,8) into outrec |
what you only need, and you're just sorting on those positions - why the number of records in input and output are not same, as Dick said? |
|
Back to top |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
Thanks sandip_mainframe... ur code helped me...
anuj Dhawan/bill
As can't copy all the 1220 bytes of data ...i gave the above data just for ur understanding...anyways thanks...
I understood the concept now... |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
ram_vizag,
If you answer the questions we can put you right. I'm not sure how the code shown so far helps you, as it is somewhat "unusual".
sandip_mainframe,
I appreciate your enthusiasm, but I'm not sure what you are trying to do. |
|
Back to top |
|
|
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Hi Bill,
I am sorry, I was bit fast to answer, without getting correct requirement, I had provided solution. I apologize for this. Going forward I will keep this in mind. |
|
Back to top |
|
|
|