Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Swap Fields thru SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Tue Feb 26, 2008 10:26 am    Post subject: Swap Fields thru SYNCSORT
Reply with quote

Hi,

Input FILE

1234 ABC 2421.00
4242 AKA 525.00
3852 SAS 2325.00

OutPut file should be
2421.00 ABC 1234
525.00 AKA 4242
2325.00 SAS 3852

Thanks
Back to top
View user's profile Send private message

Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Tue Feb 26, 2008 10:47 am    Post subject:
Reply with quote

Is your fields in fixed column or varying
Back to top
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Tue Feb 26, 2008 11:04 am    Post subject:
Reply with quote

Devzee wrote:
Is your fields in fixed column or varying


Fields in FB 80
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 195
Location: india

PostPosted: Tue Feb 26, 2008 12:10 pm    Post subject:
Reply with quote

hello shrivatsa,

you can use the following code.

I have assumed that your first filed(1234) length is 4 , second filed(ABC) length is 3 and third filed(2421.00) length is 7. If they are different then the code can be changed accordingly.

Code:
//VZM1CKKN JOB (3GAHF3,R),                                 
//         'RAJAT TEST',CLASS=X,MSGCLASS=Y,NOTIFY=&SYSUID 
//S1    EXEC  PGM=ICETOOL                                 
//TOOLMSG DD SYSOUT=*                                     
//DFSMSG  DD SYSOUT=*                                     
//IN  DD *                                                 
1234 ABC 2421.00                                           
4242 AKA 525.00                                           
3852 SAS 2325.00                                           
3333 MDK 456.00                                           
4444 SDF 3244.00                                           
4444 PLD 2335.00                                           
/*                                                         
//OUT DD SYSOUT=*                                         
//TOOLIN DD *                                             
   COPY FROM(IN) TO(OUT) USING(CTL1)                       
/*                                                         
//CTL1CNTL DD *                               
  OUTREC FIELDS=(1:10,7,X,9:6,3,X,13:1,4,64:X)
/*                                             
 
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 195
Location: india

PostPosted: Tue Feb 26, 2008 12:13 pm    Post subject:
Reply with quote

You can also use

//S1 EXEC PGM=SYNCTOOL

instead of :

//S1 EXEC PGM=ICETOOL
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Tue Feb 26, 2008 10:16 pm    Post subject: Re: Swap Fields thru SYNCSORT
Reply with quote

You can also try this:
Code:

//STEP1  EXEC  PGM=SORT
//SORTIN   DD *
1234 ABC 2421.00
4242 AKA  525.00
3852 SAS 2325.00
//SORTOUT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN      DD *
    SORT FIELDS=COPY
    OUTREC FIELDS=(1:10,7,9:6,3,13:1,4,80:X)
/*

Which produces the following output:
Code:

2421.00 ABC 1234
 525.00 AKA 4242
2325.00 SAS 3852

As rajatbagga stated, you may need to adjust the columns if this is not exactly how your data is positioned.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us