Deepti Bhopatkar
New User
Joined: 11 Apr 2006 Posts: 8 Location: Pune
|
|
|
|
Hi ,
Following is my quey . The file format is follows -
Code: |
Name Emp code Basic HRA Bonus
abc 123 50 25 25
|
I have to copy this file into another file and add 1 extra column which is
GROSS and GROSS = Basic + HRA + Bonus ( picture clause of all the amounts is same s9(9) v comp3 ) . The layout of output will be as follows -
Code: |
Name Emp code Basic HRA Bonus GROSS
abc 123 50 25 25 100
|
In short can we add some columns within 1 single row thru sort? If yes , How?
Thanks !
Deepti |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can a use a DFSORT job like the one below to do what you asked for. You didn't give the starting position of your fields, so I assumed the following layout:
Code: |
Name = 1-10
Emp code = 11-15
Basic = 16-20
HRA = 21-25
Bonus = 26-30
Gross = 31-35
|
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1,30,
31:16,5,PD,ADD,21,5,PD,ADD,26,5,PD,TO=PD,LENGTH=5)
/*
|
|
|