View previous topic :: View next topic |
Author |
Message |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Jun 06, 2007 3:40 pm Post subject: Change the field position in outrec |
|
|
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 |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Jun 06, 2007 3:42 pm Post subject: |
|
|
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 |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Wed Jun 06, 2007 3:50 pm Post subject: |
|
|
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 |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Wed Jun 06, 2007 4:07 pm Post subject: |
|
|
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 |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Wed Jun 06, 2007 4:12 pm Post subject: |
|
|
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 |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Jun 06, 2007 4:16 pm Post subject: |
|
|
Thank you very much frank and Phantom.
Its the final format. |
|
Back to top |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Jun 06, 2007 4:27 pm Post subject: |
|
|
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 |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Wed Jun 06, 2007 4:40 pm Post subject: |
|
|
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 |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Wed Jun 06, 2007 4:53 pm Post subject: |
|
|
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 |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Jun 06, 2007 5:16 pm Post subject: |
|
|
Thank you once again buddies. |
|
Back to top |
|
 |
|
|