Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Handling records in SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Handling records in SORT
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: 151
Location: Tokyo, Japan

PostPosted: Wed Aug 18, 2004 3:58 pm    Post subject:
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    Post subject:
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: 151
Location: Tokyo, Japan

PostPosted: Wed Aug 18, 2004 8:02 pm    Post subject:
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    Post subject:
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: 151
Location: Tokyo, Japan

PostPosted: Thu Aug 19, 2004 10:51 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us