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

Need help in sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pritamkarwa

New User


Joined: 04 May 2023
Posts: 5
Location: India

PostPosted: Fri May 05, 2023 5:30 pm
Reply with quote

Hi
i have a input file with few numbers on each line, i want to add 1 to all of them and write to output file

input
1
5
6
8
10
150
200

output
2
6
7
9
11
151
201

can i achieve this using sort?
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1295
Location: Bamberg, Germany

PostPosted: Fri May 05, 2023 5:48 pm
Reply with quote

Please use code tags when presenting code/data to the forum!

Yes, it's possible to do that. As this is primary a help forum, and not a write-the-code-for-me, show what you have attempted to achieve what's requested.
Back to top
View user's profile Send private message
pritamkarwa

New User


Joined: 04 May 2023
Posts: 5
Location: India

PostPosted: Fri May 05, 2023 5:52 pm
Reply with quote

i tried this but it is doing 1 as 1001 but 283 as 284.

Code:

OPTION COPY                                   
INREC BUILD=(1,4,ZD,ADD,+1,EDIT=(TTTT),X)     
END                                           

Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1295
Location: Bamberg, Germany

PostPosted: Fri May 05, 2023 6:23 pm
Reply with quote

Give this a try:
Code:
INREC BUILD=(1,4,SFF,ADD,+1,EDIT=(STTT),SIGNS=(+,-))

Input:
Code:
-2



10
150
200

Output:
Code:
-001
+006
+007
+009
+011
+151
+201


More info in the DFSORT manual, Appendix C. Data format descriptions
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts Looking for help with SORT JCL/SYNC sort DFSORT/ICETOOL 6
No new posts sort to find out the char which repea... Mainframe Interview Questions 10
No new posts Dynamically build sort control statem... SYNCSORT 18
No new posts Sort & Sum on Key SYNCSORT 7
Search our Forums:

Back to Top