View previous topic :: View next topic
|
Author |
Message |
MGayathri
New User
Joined: 19 May 2007 Posts: 25 Location: Chennai
|
|
|
|
Hi,
I have file with cloumns(c1,c2,c3), for each row I need to add c2,c3 and cross check whether it talllies with c1.Is it possible to do it with any utility. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Gayathri,
Yes, this is possible with the SORT utilities. Check the manuals for the exact syntax. |
|
Back to top |
|
|
MGayathri
New User
Joined: 19 May 2007 Posts: 25 Location: Chennai
|
|
|
|
If you have any links regarding this syntax,please let me know |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
MGayathri,
Quote: |
Hi,
I have file with cloumns(c1,c2,c3), for each row I need to add c2,c3 and cross check whether it talllies with c1.Is it possible to do it with any utility. |
Let us assume a file with LRECL=15,RECFM=F and having fields
C1:position 1 and length 5,
C2:position 6 and length 5 and
C3:position 11 and length 5.
The following sort jcl will give the SORTOUT which contains the records of sum of fields C2 and C3 is equal to C1 and OMIT which contains the records of sum of fields C2 and C3 is not equal to C1.
Code: |
// EXEC PGM=SORT
//SORTIN DD DSN=INFILE,DISP=SHR
//SORTOUT DD DSN=OUTFILE1,.....
//OMIT DD DSN=OUTFILE2,.....
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(16:6,5,ZD,ADD,11,5,ZD,M11,LENGTH=6)
OUTFIL INCLUDE=(1,5,ZD,EQ,16,6,ZD)
OUTFIL FNAMES=OMIT,SAVE
/*
// |
|
|
Back to top |
|
|
MGayathri
New User
Joined: 19 May 2007 Posts: 25 Location: Chennai
|
|
|
|
Thanks a lot for your response |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
Back to top |
|
|
|