View previous topic :: View next topic
|
Author |
Message |
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
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 |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
Is your fields in fixed column or varying |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Devzee wrote: |
Is your fields in fixed column or varying |
Fields in FB 80 |
|
Back to top |
|
|
rajatbagga
Active User
Joined: 11 Mar 2007 Posts: 199 Location: india
|
|
|
|
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 |
|
|
rajatbagga
Active User
Joined: 11 Mar 2007 Posts: 199 Location: india
|
|
|
|
You can also use
//S1 EXEC PGM=SYNCTOOL
instead of :
//S1 EXEC PGM=ICETOOL |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
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 |
|
|
|