Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

sorting two different positional fields of a VB with OUTREC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Thu Apr 04, 2013 9:17 pm    Post subject: sorting two different positional fields of a VB with OUTREC
Reply with quote

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
View user's profile Send private message

mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Thu Apr 04, 2013 9:27 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu Apr 04, 2013 11:20 pm    Post subject: Reply to: sorting two different positional fields of a VB w
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 05, 2013 1:39 am    Post subject:
Reply with quote

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
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Fri Apr 05, 2013 12:14 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Fri Apr 05, 2013 12:15 pm    Post subject:
Reply with quote

i need only these two fields (4,22) and( 1124,8) into outrec...please help
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Apr 05, 2013 12:28 pm    Post subject: Reply to: sorting two different positional fields of a VB w
Reply with quote

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
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 61
Location: pune

PostPosted: Fri Apr 05, 2013 12:28 pm    Post subject: Reply to: sorting two different positional fields of a VB w
Reply with quote

Hi Ram,

Do you want to copy data from VB file to VB file or VB file to FB file ?
Back to top
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 61
Location: pune

PostPosted: Fri Apr 05, 2013 12:50 pm    Post subject: Reply to: sorting two different positional fields of a VB w
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Apr 05, 2013 1:06 pm    Post subject:
Reply with quote

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. icon_neutral.gif

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
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Fri Apr 05, 2013 1:51 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Apr 05, 2013 1:57 pm    Post subject: Reply to: sorting two different positional fields of a VB w
Reply with quote

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
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 61
Location: pune

PostPosted: Fri Apr 05, 2013 2:13 pm    Post subject: Reply to: sorting two different positional fields of a VB w
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts SORT- outrec ram_vizag DFSORT/ICETOOL 10 Tue Sep 27, 2016 12:50 am
No new posts Stripping and Sorting of VB file G SRINIVASA RAO SYNCSORT 5 Wed Sep 14, 2016 1:34 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us