Page 1 of 1

Few IF and else and calc and display

PostPosted: Tue Sep 03, 2013 5:40 pm
by zhinghur
Hi,

I have two files, and have to do this.

if file1(4 to 8 byte) = file2(10 to 14 byte)
sum both the fields and display
else if file1(12 to 20 byte) = file2(22 to 30 byte)
substract (file2(22 to 30 byte) - file1(12 to 20 byte)
else if file1 ((value at byte 45 + value at byte 50)) < file2(value at byte 60)
sum the file2(value at byte 60) and file1 ((value at byte 45 + value at byte 50))


Please help.

Re: Few IF and else and calc and display

PostPosted: Tue Sep 03, 2013 5:42 pm
by NicC
Impossible with JCL. What programming language or utility program were you perhaps thinking of?

Re: Few IF and else and calc and display

PostPosted: Tue Sep 03, 2013 6:39 pm
by steve-myers
NicC is correct. JCL cannot analyze or manipulate data in any way. You use JCL to establish the environment for a program to execute. Period. Full stop. End of story.

The condition you appear to establish for your first IF condition is not possible to ever be equal. Similarly, the second IF statement can ever be equal.

Adding the contents of single bytes is certainly possible, but why? Assuming these are the usual 8 bit bytes, what if the sum is greater than 255? Similarly, why do the "sum" at the end. The "sum" will rapidly exceed 255.

This has to be one of the most hare brained requirement (or class assignment) I've seen posted here, and there have been some doozies.

Re: Few IF and else and calc and display

PostPosted: Tue Sep 03, 2013 7:48 pm
by dick scherrer
Hello,

As mentioned, the "requirement" is at best confusing.

Suggest you post some sample data from both input files and the output you want when your process is run.

Re: Few IF and else and calc and display

PostPosted: Wed Sep 04, 2013 11:14 am
by zhinghur
Thank you all for the response. Its not an assignment. It is one of the scenario I have to achieve at my work place. I had the same thought that it cannot be done by JCL but I have no options. Someone think its feasible as he has done such stuff in the past.

I will try to post with file actual data, and correct requirement after some time.

Re: Few IF and else and calc and display

PostPosted: Wed Sep 04, 2013 11:47 am
by BillyBoyo
It can (probabably) be done with your SORT package. That is not JCL.

Which SORT package do you use, and can you make the requirement a little clearer?

Can somone find the "similar" code at your site?

Re: Few IF and else and calc and display

PostPosted: Mon Sep 09, 2013 11:09 am
by zhinghur
Hi Billy,
Yes you are right. I was able to acheive this using ICETOOL. Great thanks.

Re: Few IF and else and calc and display

PostPosted: Mon Sep 09, 2013 8:10 pm
by dick scherrer
Hello,

Good to hear it is working - thank you for letting us know :)

If you post your working JCL and control statements, it will prpobably help someone else in the future ;)

d