MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re-arrange columns using Sort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
stalin
Beginner


Joined: 22 Aug 2005
Posts: 23
Topics: 4

PostPosted: Mon Sep 26, 2005 7:04 am    Post subject: interchanging colums Reply with quote

Dear kolusu,


I have a data set of
record length : 80
record fromat : FB
block size : 800

It has three colums

cloumn1 cloumn 2 column 3

abcdef 1234 5678
afedg1 9923 3234
.
.
..
.and so on.

now in the output dataset i want to intercange the column1 and column 2
that is

cloumn2 cloumn 1 cloumn 3

how do i do that.

can you please help on this.

thanks
Back to top
View user's profile Send private message  
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Sep 26, 2005 7:22 am    Post subject: Reply with quote

Stalin,

Please do not address me personally requesting help . There are many people who help in here along with me. Also do not tag your questions to an already existing questions and which do not have any relation to your current question.

I am moving your question as seperate topic titled "Re-arrange columns using Sort"

As for your question, it is a simple task using OUTREC FIELDS.

Code:

//SYSIN DD *
  SORT FIELDS=COPY
  OUTREC FIELDS=(8,5,    $ FIELD2 AT POS 8 FOR 6 BYTES
                 1,7,    $ FIELD1 AT POS 1 FOR 7 BYTES
                 13,68)  $ REST OF THE FIELDS


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website  
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Tue Jul 29, 2008 10:06 am    Post subject: Mine is not working properly. Reply with quote

Hi,

I am using below shown sort card to achieve the rearrangement of columns. I am trying to move 68th column to 75th column.

Below is my input data......

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
KAMBA.HFS                                                          0.0017
KAMBA.KUMAR.XXXX.XXXXX.XXXXXXX.ERRORS                              0.0001
KAMBA.KUMAR.XXX.DBRM                                               0.0376
KAMBA.KUMAR.XXX.FORMAT                                             0.035


Code:

//SYSIN    DD *           
  SORT FIELDS=COPY       
  OUTREC FIELDS=(1,44,   
                   75,6, 
                   45,30)
/*                       


It is moving the column (6 characters) from 68th to 75th column but leaving a blank in 80th column !!!

Would you please correct my problem.

TIA.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail  
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jul 29, 2008 10:46 am    Post subject: Reply with quote

In order to move 6 characters from column 68 to column 75, you would need to use:

75:68,6

75: gives the starting output column as 75.
68,6 gives the input field to move as 68,6.

It's not clear what you're trying to do with the rest of the record, so I can't show you the complete control statements.

If you need more help, show what you expect for the output record and explain the "rules" for getting from input to output.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website  
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group