Few IF and else and calc and display



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Few IF and else and calc and display

Postby zhinghur » Tue Sep 03, 2013 5:40 pm

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.
zhinghur
 
Posts: 48
Joined: Sun Nov 20, 2011 12:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Few IF and else and calc and display

Postby NicC » Tue Sep 03, 2013 5:42 pm

Impossible with JCL. What programming language or utility program were you perhaps thinking of?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Few IF and else and calc and display

Postby steve-myers » Tue Sep 03, 2013 6:39 pm

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Few IF and else and calc and display

Postby dick scherrer » Tue Sep 03, 2013 7:48 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Few IF and else and calc and display

Postby zhinghur » Wed Sep 04, 2013 11:14 am

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.
zhinghur
 
Posts: 48
Joined: Sun Nov 20, 2011 12:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Few IF and else and calc and display

Postby BillyBoyo » Wed Sep 04, 2013 11:47 am

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Few IF and else and calc and display

Postby zhinghur » Mon Sep 09, 2013 11:09 am

Hi Billy,
Yes you are right. I was able to acheive this using ICETOOL. Great thanks.
zhinghur
 
Posts: 48
Joined: Sun Nov 20, 2011 12:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Few IF and else and calc and display

Postby dick scherrer » Mon Sep 09, 2013 8:10 pm

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
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post