IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Handling records in SORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Wed Aug 18, 2004 12:06 pm
Reply with quote

Hi,

Again a doubt in SORT. My requirement is this:
There is seq file with the following data:

File1:

345
10
100

Now I want my output file (Say File2) to have the value arrived from 345-(10+100). i.e First record - (Second +Third record). If needed some unique characters can be added to the file (like the first character as 1 for first record,2 for third and 3 for fourth. I know there are ADD and MULTIPLY commands in SORT, but is it possible to apply them for different records..

Hope my requirement is clear. Please let me know if it is possible through SORT (Even ICETOOL is fine) ASAP.
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 150
Location: Tokyo, Japan

PostPosted: Wed Aug 18, 2004 3:58 pm
Reply with quote

What will be the case in last and last but one records?

regards,
Sandip.
Back to top
View user's profile Send private message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Wed Aug 18, 2004 4:49 pm
Reply with quote

Sorry Sandip... I didn't get you.

If you are asking about the unique characters that I've mentioned, it should be like this:

1 345
2 10
3 100

And there are only 3 records in this file.
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 150
Location: Tokyo, Japan

PostPosted: Wed Aug 18, 2004 8:02 pm
Reply with quote

I think ADD and MULTIPLY do not apply to multiple records.
Your input looks like -
345
10
100

Your expected output -
235 [345 - (10+100)]
?? [10 - (100+?)]
?? [100 - (?+?)]

What will be there in place of "?" ?

Regards,
Sandip.
Back to top
View user's profile Send private message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Thu Aug 19, 2004 9:57 am
Reply with quote

My output needs only one record:

235 [345 - (10+100)]

Even I tried in all the help topics and forums, and I think it is not possible with SORT. Let me know if there is any way.

Thanks for the response.
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 150
Location: Tokyo, Japan

PostPosted: Thu Aug 19, 2004 10:51 am
Reply with quote

You can definitely write program using COBOL. But that will not be worthy for just this work.
You can try EASYTRIEVE if you have this installed in your shop. Let me know, then I can give you the code.

Regards,
Sandip.
Back to top
View user's profile Send private message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Thu Aug 19, 2004 4:29 pm
Reply with quote

We do have EASYTRIEVE. But I do not know to code in it. It would be nice if you could give me the code with simple comments on them. Thanks.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top