Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 6 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us