Posted: Sat Oct 18, 2008 2:20 pm Post subject: Comparing values from different reports
I have two jobs which produce reports seperately for example as below:
DAY 1
Code:
REPORTA
X 25.00
Y 32.00
Code:
REPORTB
X 40.00
Y 32.00
DAY 2
Code:
REPORTA
X 10.00
Y 45.00
Code:
REPORTB
X 5.00
Y 40.00
X & Y are some calculated values.
Daily as of now X from Report A is taken and subtracted from X of REPORT B manually as of today it is -15 let us call as Z.Similarly Y is taken daily from Report A and subtracted from Y of Report B manually as of today is 0 let us call as Z. Now both Z's are compared daily which is again manually done and -15 is not equal to 0 and Balance out of Condition is raised for Day 1 whereas for Day 2 Balance in condition is raised as 5 = 5.Somedays the values of Z's is same and Balance In condition is raised.Now I want to give a suggestion if possible can this process be done automatically and the status of the condition I want to send it as an email to the person who is responsble for doing this work manually so that he does not have to calcuate the difference daily and decide Balance / Out of Balance Condition.I am thinking SORT can achieve this result.Can anyone help me in this problem , the values in the report are in edited fashion and each report is produced by executing different programs seperately.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Sun Oct 19, 2008 12:20 pm Post subject:
yadav2005,
The following JCL will create a single record with text 'BALANCE IN CONDITION' or 'BALANCE OUT OF CONDITION ' depending on the totals. You can send this file as an email.
Thanks for the reply. But I have few constraints here , both the reports goes to spool ,so how do we put the reports in SORTIN and the formats of the reports are not exactly same , they are different i showed the output for simpilicity but positions of values of X & Y is known in both reports ,please let me know how it can be achieved and i hope i am clear in my question.Thanks.
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
Posted: Tue Oct 21, 2008 1:18 am Post subject:
Search for SDSF in batch. It is easy to copy output from the spool into a dataset for further processing, although you may have to increment the field positions by one to account for any carriage control bytes that get added. _________________ If it's true that we are here to help others,
then what exactly are the others here for ?
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Tue Oct 21, 2008 9:25 am Post subject:
You could also write the output to dataset and then add a step to copy it to the spool. You then process the dataset.
Alternatively, you could, even, modify the process that produces the report so that the relevant lines are written to a dataset as well as to the report. _________________ Utility and Program control cards are NOT, repeat NOT, JCL.
What I have done is I have updated two programs to generate only the X & Y values to a dataset in both comp-3 form.
So in first dataset
Code:
X : &
Y :
Comp-3 data is of 6 bytes starting from pos 6 - 11 pos and as of now X is 25.00 and Y is -32.00
So in second dataset
Code:
X :
Y :
Comp-3 data is of 6 bytes starting from pos 6 - 11 pos and as of now X is 40.00 and Y is -10.00
Now the differnce between X's 25.00 and 40.00 is -15.00 , difference between Y's -32.00 - (-10.00) is -22.00 which is BALANCE OUT OF CONDITION
Now how can i change my code , please help to tailor my needs and i want the output in the below format to a dataset so that i can send as an email further.
Code:
BALANCE OUT OF CONDITION
DIFFERENCE BETWEEN X: -15.00 (this should be in readible format)
DIFFERENCE BETWEEN Y: -22.00 (this should be in readible format)
SINCE BOTH DIFFERENCES ARE NOT SAME BALANCE OUT OF CONDITION IS RAISED
If a BALANCE IN CONDITION is raised i want the output as
Code:
BALANCE IN CONDITION
DIFFERENCE BETWEEN X: -10.00 (this should be in readible format)
DIFFERENCE BETWEEN Y: -10.00 (this should be in readible format)
SINCE BOTH DIFFERENCES ARE SAME BALANCE IN CONDITION IS RAISED
I have another question if in a report / dataset ,if we have a value which is in readable format say as below:
Code:
123.45
can we convert this value to a comp-3 format and store in a dataset.
Please help me how to achieve this two requirements.Hope i am clear in my question.
OUTFIL IFTHEN=(WHEN=(2,6,PD,EQ,8,6,PD),
BUILD=(80X,/,C'BALANCE IN CONDITION',/,80X,/,
C'DIFFERENCE BETWEEN X: ',
2,6,PD,EDIT=(SIIIIIIIIT.TT),SIGNS=(,-),/,
C'DIFFERENCE BETWEEN Y: ',
8,6,PD,EDIT=(SIIIIIIIIT.TT),SIGNS=(,-),/,80X,/,
C'SINCE BOTH DIFFERENCES ARE SAME BALANCE IN',
C' CONDITION IS RAISED',80:X)),
IFTHEN=(WHEN=NONE,
BUILD=(80X,/,C'BALANCE OUT OF CONDITION',/,80X,/,
C'DIFFERENCE BETWEEN X: ',
2,6,PD,EDIT=(SIIIIIIIIT.TT),SIGNS=(,-),/,
C'DIFFERENCE BETWEEN Y: ',
8,6,PD,EDIT=(SIIIIIIIIT.TT),SIGNS=(,-),/,80X,/,
C'SINCE BOTH DIFFERENCES ARE NOT SAME BALANCE',
C' OUT OF CONDITION IS RAISED',80:X))
/*
Yadav2005 wrote:
I have another question if in a report / dataset ,if we have a value which is in readable format say as below:
Code:
123.45
can we convert this value to a comp-3 format and store in a dataset.
Yes you can. Simply use UFF format for unsigned values and SFF format for signed values
for ex if the value 123.45 starts at pos 5 for a length of 9, you can use the following statement to convert that number into comp-3 format
Code:
INREC OVERLAY=(5:5,9,UFF,PD,LENGTH=9)
This will create a 9 byte comp-3 variable in pos 5
If you have signed values then use the following statement
Code:
INREC OVERLAY=(5:5,9,SFF,PD,LENGTH=9)
This will create a 9 byte comp-3 variable in pos 5
Thanks a lot and a ton for your help and you have always helped with a very clear explanation.Any kind of problem with file manipulations with SORT ,Kolusu and Frank are there.
A question more why are u using ICEMAN instead of SORT , what are the advantages of using ICEMAN instead of SORT , i guess ICEMAN uses SORT as it background.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Oct 23, 2008 11:17 am Post subject:
yadav2005 wrote:
Kolusu,
A question more why are u using ICEMAN instead of SORT , what are the advantages of using ICEMAN instead of SORT , i guess ICEMAN uses SORT as it background.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum