SORT JCL to modify input file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

SORT JCL to modify input file

Postby nishantsinghal » Tue Jun 07, 2016 4:42 pm

Hi Mainframers,

I need your help to modify my input file as per my specific requirement. I have to do it through JCL only and I can not use COBOL/REXX/SAS.

I/P File - Record length 80 Bytes

File has some details in first few lines and then count of records at some fixed position (suppose 50)...See file below

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA


No of records in file 1 - 2000
No of records in file 2 - 4000
No of records in file 3 - 1000
No of records in file 4 - 3000
No of records in file 5 - 2000


O/P File: Record Length - 80 Bytes (Everything would remain same in O/P file except the count of No. of records...requirement is to subtract 1 from the no. of records)

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA


No of records in file 1 - 1999
No of records in file 2 - 3999
No of records in file 3 - 999
No of records in file 4 - 2999
No of records in file 5 - 1999


Please provide your suggestion and if requirement is still not clear then please let me know, will try to explain it in better way.

Regards,
Nishant Singhal

Coded, FWIW
nishantsinghal
 
Posts: 10
Joined: Tue Oct 06, 2009 8:09 pm
Has thanked: 1 time
Been thanked: 0 time

Re: SORT JCL to modify input file

 

Re: SORT JCL to modify input file

Postby Aki88 » Tue Jun 07, 2016 5:09 pm

nishantsinghal wrote:I have to do it through JCL only and I can not use COBOL/REXX/SAS.


If above is the final word for the requirement; then - sorry, you're out of luck - because JCL by itself doesn't really do anything.
Instead, if you were looking for help with a program (for instance DFSORT/SYNCSORT etc) - which can be run through JCL to satify the requirement, then maybe there is still some hope.
Aki88
 
Posts: 362
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 34 times

Re: SORT JCL to modify input file

Postby Aki88 » Tue Jun 07, 2016 7:31 pm

Follow-on to the last post; in case you do think of using a SORT product for the requirement, then look at 'INREC IFTHEN=(WHEN' coupled with BUILD, using 'SUB' function.
Aki88
 
Posts: 362
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 34 times

Re: SORT JCL to modify input file

Postby NicC » Tue Jun 07, 2016 8:35 pm

You used SORT in your topic title so why did you not post in the sort part of the forum?

Moving to DFSort. If your sort product is Syncsort then it can be moved again.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2663
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 100 times

Re: SORT JCL to modify input file

Postby nishantsinghal » Tue Jun 07, 2016 11:25 pm

Aki88

I am okay with DFSORT/SYNCSORT/ICETOOL program but I am not suppose to use any new COBOL/REXX/SAS.

I would be great if you can provide me the exact sort card for my requirement but it does not mean I am not trying myself to get the desired results. Thanks!

NicC,

Just to give subject to my query, I used SORT otherwise its not specific to SORT program only. Please move it to appropriate location, I do not have any objection. Thanks!
nishantsinghal
 
Posts: 10
Joined: Tue Oct 06, 2009 8:09 pm
Has thanked: 1 time
Been thanked: 0 time

Re: SORT JCL to modify input file

Postby BillyBoyo » Wed Jun 08, 2016 3:00 am

As Aki88 has noted already, use IFTHE=(WHEN=(logical expression) to identify the records you want to change, and then use OVERLAY to just change the field you want, with SUB. Make sure you specify a length for the result.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 263 times

Re: SORT JCL to modify input file

Postby NicC » Wed Jun 08, 2016 4:00 am

Well, JCL does not manipulate data - you need a program of some kind be it written by you or a utility eg your sort product.
Your examle input and output does not appear to contain any count whatsoever. And what are datasets 1-5? Are they to be processed in one execution one file per execution? Do all the files have the same characteristics? And why are you mangling record counts? If these are production datasets then you should have an audit report of the changes. Also, how did a program that did not count correctly get ito production? If they are testing then why not go and change them by hand?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2663
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 100 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post