I got one requirement and able to write a code in cobol.
But, It would be great if I able to get this in sort card in Jcl. Can someone please help me in this?
Here are my Requirement is
InputFile:( header record has sequence number)
FHR00000001P08KGAE1617XXV0000291862020071014161700000000
CountFile(Contains Expected next Sequence Number):
00002918
I need to read the InputFile and check the sequence number from CountFile and update the CountFile as per below scenarios and conditions and execute new step.
Execution| CountFile| InputFile| Conditions | CountFile(To be updated) | NewStep(to be executed)
Execution1 | 00002918 | 00002918 | InputFile = CountFile | 00002919 (Incremented by 1 from Input file count) | No
Execution2 | 00002919 | 00002919 | InputFile = CountFile | 00002920 (Incremented by 1 from Input file count) | No
Execution3 | 00002920 | 00002922 | InputFile > CountFile | 00002923 (Incremented by 1 from Input file count) | Yes
Execution4 | 00002923 | 00002920 | InputFile < CountFile | 00002923 (No Increment,same from Input file count) | No
Execution5 | 00002923 | 00002923 | InputFile = CountFile | 00002924 (Incremented by 1 from Input file count) | No
Execution6 | 00002924 | 00002921 | InputFile < CountFile | 00002924 (No Increment,same from Input file count) | No
Execution7 | 00002924 | 00002924 | InputFile = CountFile | 00002925 (Incremented by 1 from Input file count) | No
Execution8 | 00002925 | 00002926 | InputFile > CountFile | 00002927 (Incremented by 1 from Input file count) | Yes
can someone help to get this via JCL sort utility?
And I am unable to execute and I checked with our team and it seems like I can't use ICEMAN.
However, I can use ICETOOL and SORT utility.
Q1. Is there a way to acheive it using ICETOOL or SORT?
And Input file has more records (Header, Body and Trailer Records).
I need to use take the sequence number from Header record only.
InputFile:( header record has sequence number with 9 digits starts from 26th position to 35th Position.)
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
Replace EXEC PGM=ICEMAN with EXEC PGM=SORT and make sure you use the second Sample I have posted. I put that one also Online because I was thinking about the HDR/Data/TRL scenario as a possible one too.
But, It would be great if I able to get this in sort card in Jcl.
There is no such thing as "sort card in Jcl", or even as "SORT card in JCL"!
"SORT card" is actually one of multiple control statements of one of SORT utilities (mainly two of them, the most popular ones); those utilities have no more relation to JCL language than any other executable program (load module) in the mainframe world.
Even more: the control statement SORT of a SORT utility can do very little without other multiple control statements of the same SORT utilities.
It is important to use the exact terminology when discussing or questioning such issues.
Welcome!!
If this step gives you RC-4 then execute next step else No. Either case the CFIL will have the count that you looking for and use the same file as SORTJNF1. Ignore SDUMMY as its is just to control the RC.
I can able to execute the code.
But our upstream system has changed the requirement and design also modified.
I apologize for this.
New requirement is
And Input file has more records (Header, Body and Trailer Records).
I need to use take the sequence number from Header record only.
InputFile:( header record has sequence number with 9 digits starts from 26th position to 35th Position.)
It looks like you've received a very good help in previous responses. The given ideas are supposed to force you begin thinking with your own mind, instead of begging new charity after you've got "a new requirement" from your management, isn't it?
This forum is mainly not to do other people's job free of charge, but rather to teach them: HOW TO THINK WITH THEIR OWN BRAINS.
So I have executed line by line and understood the code.
I can see PUSH=(57:SEQ=1,58:1,9)),
this code pulls the data from the same record.
However, after the requirement change, I need to pull the first record in the second line also where we are adding the key field 2 and 9.
But Not sure how to to acheive this.
Thats why I posted again.
I will go thru some more posts in this forum and understand the SORT functionality and respective commands and try to solve this.
I apologize once again for the inconvenience caused.
If you can not modify even 0.01% to the working code provided above to your earlier requirement to be able to modify for the little "requirement change" then that means you must really need to start looking at the DFSORT manuals from the start before attempting anything further in DFSORT and continue with your COBOL version running until then.