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

Copy records from i/p to o/p with vary in field positions


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 123
Location: Hyderabad

PostPosted: Thu Jul 12, 2007 10:17 am
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jul 12, 2007 10:50 am
Reply with quote

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
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Thu Jul 12, 2007 10:57 am
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Jul 12, 2007 1:26 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Jul 12, 2007 8:40 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top