View previous topic :: View next topic
|
Author |
Message |
Srinivasan Selvam
New User
Joined: 25 May 2012 Posts: 11 Location: india
|
|
|
|
Hi all,
We have a input file, which is like below.
Code: |
<NAME1> <NAME 2> <RECORD1> <RECORD2> <MATCH IND>
TABLE 1 TABLE 1 10 10 Y
TABLE 2 TABLE 2 30 30 Y
TABLE 3 TABLE 3 401 401 Y
TABLE 4 TABLE 4 105 105 Y
TABLE 5 10 N
TABLE 5 15 N
TABLE 6 TABLE 6 101 101 Y
|
NAME 1 - 40 bytes
NAME 2 - 40 bytes
Record 1 - 10 bytes
Record 2 - 10 bytes
Match Ind - 2 bytes
I would like to have the output as below.
Code: |
TABLE 1 TABLE 1 10 10 Y
TABLE 2 TABLE 2 30 30 Y
TABLE 3 TABLE 3 401 401 Y
TABLE 4 TABLE 4 105 105 Y
TABLE 5 TABLE 5 10 15 N
TABLE 6 TABLE 6 101 101 Y
|
Suggestions please on how to achieve this. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1350 Location: Bamberg, Germany
|
|
|
|
Code: |
//WHATEVER EXEC PGM=ICEMAN
//SORTIN DD *
<NAME1> <NAME 2> <RECORD1> <RECORD2> <MATCH IND>
TABLE 1 TABLE 1 10 10 Y
TABLE 2 TABLE 2 30 30 Y
TABLE 3 TABLE 3 401 401 Y
TABLE 4 TABLE 4 105 105 Y
TABLE 5 10 N
TABLE 5 15 N
TABLE 6 TABLE 6 101 101 Y
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OMIT COND=(1,1,CH,EQ,C'<')
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,7,CH,NE,C' '),PUSH=(1,7))
OUTFIL FNAMES=(SORTOUT),
REMOVECC,NODETAIL,
SECTIONS=(1,7,
TRAILER3=(1,28,TOT=(30,10,SFF),X,TOT=(41,10,SFF),51,19))
END
/* |
|
|
Back to top |
|
|
Srinivasan Selvam
New User
Joined: 25 May 2012 Posts: 11 Location: india
|
|
|
|
Hi Joerg,
Actually there was no record in input file having value within <>.
That's for showing the input layout.
Input layout is
Code: |
Table details from file 1 - 40 bytes
Space
Table details file file 2 - 40 bytes
Space
Table record count from file 1 - 10 bytes
Table record count from file 2 - 10 bytes
Space
Matching indicator - 1 byte |
So LRECL of input file is FB/104.
Sorry for the confusion. |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
Srinivas,
Did you try Joerg’s solution? |
|
Back to top |
|
|
Srinivasan Selvam
New User
Joined: 25 May 2012 Posts: 11 Location: india
|
|
|
|
Hi Joerg / Dave,
I have modified the code and finally the output came as expected.
Thanks!.
Code: |
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,40,CH,NE,C' '),PUSH=(1,40))
OUTFIL FNAMES=(SORTOUT),
REMOVECC,NODETAIL,
SECTIONS=(1,40,
TRAILER3=(1,70,TOT=(81,10,SFF),TOT=(91,10,SFF),103,1))
END
/*
|
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2157 Location: USA
|
|
|
|
Srinivasan Selvam wrote: |
Hi Joerg / Dave,
I have modified the code and finally the output came as expected.
Thanks!.
|
You've demonstrated good results in arithmetic calculations, between 1 and 100! |
|
Back to top |
|
|
|
|