View previous topic :: View next topic
|
Author |
Message |
bhaskar_kanteti
Active User
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
|
|
|
|
Hi,
I need to copy all the records from input file to output file but the position of fields will be different.
ie. The 10th field from input file should be the first field in output file, 12th field from input file should be the second field in output file, 1st field from input file should be the third field in output file and so on....
What i mean to say is the filed positions from my input file to output file will vary.
So how can i do this using ICETOOL.
Thanks in advance. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Fields in a record or records in a file?
It would be much clearer if you posted an example of your input and what you expected the output to look like. |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
from your post - looks like you want to reformat fields from input to output.
if this is what you wanted to do then you can use OUTREC and give field positions. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
bhaskar_kanteti
This simple DFSORT JCL illustrates how the reformat of the record's from i/p to o/p can be done:
Code: |
//*******************************************************
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
111122223333
AAAABBBBCCCC
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(9,4, *COPY 3RD FIELD TO FIRST FIELD
1,4, *COPY 1ST FIELD TO SECOND FIELD
5,4) *COPY 2ST FIELD TO THIRD FIELD
/*
|
SORTOUT would contain
Code: |
333311112222
CCCCAAAABBBB
|
You need not use ICETOOL - this can be accomplished by simple DFSORT statements. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
bhaskar_kanteti,
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:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|