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 

Change the field position in outrec

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


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Jun 06, 2007 3:40 pm    Post subject: Change the field position in outrec Reply with quote

Hi,
I have the below data, where I need to flip the first three positions with the next three positions. I know this is tricky .. any help is greatly appreciated.
Quote:

A015010000778
A015010001020
A015010002294
A015010003080
A015010006360


I need that to be like this..
Quote:

501A010000778
501A010001020
501A010002294
501A010003080
501A010006360
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Jun 06, 2007 3:42 pm    Post subject: Reply with quote

Sorry, I forgot to mention that the file is FB with LRECL = 13 and Its not sorted and the output should be sorted. (1,13)
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Jun 06, 2007 3:50 pm    Post subject: Reply with quote

vak255,

You have been a member of this board for the past 3 years and it is hurting to see that you do not follow the board rules....Please search before posting...

This is a basic query in outrec - and all sort manuals have tons of examples for doing this re-arrangement / reformatting of fields.

check this link
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/3.14.2?DT=20050222160456

Thanks,
Phantom
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Wed Jun 06, 2007 4:07 pm    Post subject: Reply with quote

Quote:
I know this is tricky


Not at all tricky. Quite straightforward actually. Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/13)
//SORTOUT DD DSN=...  output file (FB/13)
//SYSIN    DD    *
  INREC BUILD=(1:4,3,4:1,3,7:7,7)
  SORT FIELDS=(1,13,CH,A)
/*


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


Last edited by Frank Yaeger on Wed Jun 06, 2007 4:51 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Wed Jun 06, 2007 4:12 pm    Post subject: Reply with quote

vak255 wrote:
and the output should be sorted. (1,13)
Is that 1,13 of the original fomat or the final format?
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Jun 06, 2007 4:16 pm    Post subject: Reply with quote

Thank you very much frank and Phantom.
Its the final format.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Jun 06, 2007 4:27 pm    Post subject: Reply with quote

Phantom, I searched but could not get what I need may be my query was not effective. Sure I will look into manuals first before i post.

Thanks once again guys.
Back to top
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Wed Jun 06, 2007 4:40 pm    Post subject: Reply with quote

vak255 wrote:
Thank you very much frank and Phantom.
Its the final format.
Frank's example modifies the date during input. When it hits the SORT, it is in final format. Just replace the COPY with a SORT parm and your output will be sorted to its final format.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Wed Jun 06, 2007 4:53 pm    Post subject: Reply with quote

Oops. I missed the part about sorting. Thanks CICS guy for pointing that out.

I modified my job to do a sort on the rearranged bytes.
_________________
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
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Jun 06, 2007 5:16 pm    Post subject: Reply with quote

Thank you once again buddies.
Back to top
View user's profile Send private message
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