IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT Copying a VB file using OUTREC


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abhay pratap singh

New User


Joined: 22 Nov 2007
Posts: 77
Location: noida

PostPosted: Tue Feb 12, 2008 8:31 pm
Reply with quote

I have a physical sequential(PS) file which is VB and length of 14172. I want to remove data of 44th to 50th column and move data from 51st column to 44th column in the output file.
I tried using OUTREC facility in SORT utility but not getting the expected result. Below is the outrec statement i have used

Code:

  SORT FIELDS=COPY
  OUTREC FIELDS=(1:1,43,44:51,14165)


Can anyone provide me solution.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Feb 12, 2008 10:40 pm
Reply with quote

Try the following:
Code:

SORT FIELDS=COPY
OUTREC FIELDS=(1:1,43,44:51)
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue Feb 12, 2008 10:55 pm
Reply with quote

And since this is a VB file, you may want to take in account the first 4 RDW too.

So this is how your OUTREC should look like.

Code:
OUTREC FIELDS=(1:1,4,5:5,43,48:55)
OR                               
OUTREC FIELDS=(1:1,47,48:55)     
Back to top
View user's profile Send private message
abhay pratap singh

New User


Joined: 22 Nov 2007
Posts: 77
Location: noida

PostPosted: Wed Feb 13, 2008 10:15 am
Reply with quote

priyesh.agrawal wrote:
And since this is a VB file, you may want to take in account the first 4 RDW too.



In case of PS do we also need to take care of 4 RDW bytes or it is in case of only VSAM files.
Back to top
View user's profile Send private message
Santoshdorge

New User


Joined: 27 Jun 2006
Posts: 48
Location: Pune

PostPosted: Wed Feb 13, 2008 10:43 am
Reply with quote

Hi

Quote:
In case of PS do we also need to take care of 4 RDW bytes or it is in case of only VSAM files.


We need to take care of 4 RDW bytes in case of VB record format no matter which file organisation you r using( PS/VSAM).


Thanks,
Santosh.
Back to top
View user's profile Send private message
abhay pratap singh

New User


Joined: 22 Nov 2007
Posts: 77
Location: noida

PostPosted: Wed Feb 13, 2008 11:34 am
Reply with quote

Thanks all for providing the solution.
Back to top
View user's profile Send private message
geethaelisha

New User


Joined: 03 Mar 2004
Posts: 1

PostPosted: Thu May 26, 2011 12:29 pm
Reply with quote

Priyesh's reply was very useful for me. The second option given did not work for me. I had to give the RDW block separately. icon_smile.gif
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu May 26, 2011 12:34 pm
Reply with quote

Always nice adding comments to a 3 year old thread icon_biggrin.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 26, 2011 12:46 pm
Reply with quote

good to see that we have somebody who, contrary to the habits of these forums does some searching and reading on his own !
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu May 26, 2011 2:38 pm
Reply with quote

And I wonder, geethaelisha, has made only 1 post since inception and that too of this nature! icon_smile.gif
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu May 26, 2011 11:52 pm
Reply with quote

priyesh.agrawal wrote:
And since this is a VB file, you may want to take in account the first 4 RDW too.

So this is how your OUTREC should look like.

Code:
OUTREC FIELDS=(1:1,4,5:5,43,48:55)
OR                               
OUTREC FIELDS=(1:1,47,48:55)     


Hi Priyesh,

Can you clarify one thing.... If we are copying 1st 4 bytes as it is... will it not make any problem as we are altering the VB length as not copying some bytes.??
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri May 27, 2011 12:19 am
Reply with quote

gylbharat wrote:
priyesh.agrawal wrote:
And since this is a VB file, you may want to take in account the first 4 RDW too.

So this is how your OUTREC should look like.

Code:
OUTREC FIELDS=(1:1,4,5:5,43,48:55)
OR                               
OUTREC FIELDS=(1:1,47,48:55)     


Hi Priyesh,

Can you clarify one thing.... If we are copying 1st 4 bytes as it is... will it not make any problem as we are altering the VB length as not copying some bytes.??

Since Priyesh has not been heard from in nearly two years, I suspect that he will not clarify...

DFSORT would require the unedited RDW be copied. I can't say for certain, but it is very likely that SyncSort requires the same.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri May 27, 2011 4:30 pm
Reply with quote

Akatsukami wrote:
gylbharat wrote:
priyesh.agrawal wrote:
And since this is a VB file, you may want to take in account the first 4 RDW too.

So this is how your OUTREC should look like.

Code:
OUTREC FIELDS=(1:1,4,5:5,43,48:55)
OR                               
OUTREC FIELDS=(1:1,47,48:55)     


Hi Priyesh,

Can you clarify one thing.... If we are copying 1st 4 bytes as it is... will it not make any problem as we are altering the VB length as not copying some bytes.??


Since Priyesh has not been heard from in nearly two years, I suspect that he will not clarify...

DFSORT would require the unedited RDW be copied. I can't say for certain, but it is very likely that SyncSort requires the same.


As DFSORT requires the unedited RDW, Then how it is able to determine the correct length of the file?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri May 27, 2011 7:08 pm
Reply with quote

gylbharat wrote:
Akatsukami wrote:
DFSORT would require the unedited RDW be copied. I can't say for certain, but it is very likely that SyncSort requires the same.


As DFSORT requires the unedited RDW, Then how it is able to determine the correct length of the file?

I do not know DFSORT/SyncSort internals, but I expect that they track the length of the logical record that they are working with, and update the RDW accordingly.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri May 27, 2011 9:40 pm
Reply with quote

Quote:
As DFSORT requires the unedited RDW, Then how it is able to determine the correct length of the file?


DFSORT does NOT require the unedited RDW for the reformatted record. It just requires the RDW (1,4) as a "placeholder" since a VB record requires an RDW as the first four bytes. DFSORT determines the record length dynamically and puts it in the first two bytes of the RDW.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri May 27, 2011 11:46 pm
Reply with quote

Thanks Frank for the explanation... icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top