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
 

 

Assigning particular numbers to a field using sort overlay

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Vigneshkumar D

New User


Joined: 04 Jul 2011
Posts: 2
Location: india

PostPosted: Mon Jul 04, 2011 10:50 am    Post subject: Assigning particular numbers to a field using sort overlay
Reply with quote

Hi need a sort card to perform the below function.
I am reading records from a input file and checking for a field.
If the field has value as 'NEW' then I have to give number 1 for that record.
Similarly if the filed has value as 'ADD' then I have to give number 2 for that record.
Similarly if the value is 'UPD' then the numbering will be 3.
I will use a filler for this numbering.
I just need a sort card to perform this function.
Can someone help me to do this?
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1491
Location: Chennai

PostPosted: Mon Jul 04, 2011 10:56 am    Post subject:
Reply with quote

Hello,
Welcome to the forum. Search for IFTHEN=(WHEN=( on the forum for the requirement.

Hope it helps.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1491
Location: Chennai

PostPosted: Mon Jul 04, 2011 11:01 am    Post subject: Reply to: Assigning particular numbers to a field using sort
Reply with quote

Something like,
Code:
   OPTION COPY                           
   INREC IFTHEN=(WHEN=(22,3,CH,EQ,C'NEW'),
              OVERLAY=(22:C'  1')),         
   INREC IFTHEN=(WHEN=(22,3,CH,EQ,C'ADD'),
              OVERLAY=(22:C'  2')),   
.
.
.
Back to top
View user's profile Send private message
Vigneshkumar D

New User


Joined: 04 Jul 2011
Posts: 2
Location: india

PostPosted: Mon Jul 04, 2011 11:35 am    Post subject:
Reply with quote

Thank you Vasanth for your response.
Actually I need the numbering to be in number not character because I need to sort the file again based on that number.
So could you please help me to do that?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1491
Location: Chennai

PostPosted: Mon Jul 04, 2011 11:42 am    Post subject:
Reply with quote

Hello,
You could meddle with the above sample code and change it according to your requirement by changing things like C' 1' TO C'001' etc... A SORT FIELDS statement below would sort the fields that are numeric or characters.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Mon Jul 04, 2011 11:42 am    Post subject: Reply to: Assigning particular numbers to a field using sort
Reply with quote

sorting on 1,2,3 as zoned numbers, will result in the same sequence as sorting on '1','2','3' as chars or 'bb1','bb2','bb3' as same

but if You had told the requirement from the beginning You might have got the whole tee shirt icon_cool.gif

and if You had searched the forum You would have found this
http://www.ibmmainframes.com/viewtopic.php?t=55069&highlight=

and it should not have been a big effort to modify it according to Your needs
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jul 04, 2011 12:22 pm    Post subject:
Reply with quote

Vigneshkumar D wrote:


[...]

Actually I need the numbering to be in number not character because I need to sort the file again based on that number.

[...]




The hexadecimal values for "character" 1, 2, 3 are x'F1', x'F2', x'F3'.
The hexadecimal values for "zoned decimal" 1, 2, 3 are x'F1', x'F2', x'F3'.

Identical. Even if they were not identical, they would appear in the same sequence in the sort, as 1 is always before 2 is always before 3 no matter how the field is defined (since you are generating them, we know they are all "positive" numbers - you could generate negative numbers and see the difference it makes to a sort).
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jul 04, 2011 12:44 pm    Post subject:
Reply with quote

Follow on:

If you want a specific type of field for documentary purposes (you mention FILLER, so I'll assume it is going into a Cobol program) you can always change the sort cards yourself. If you don't know what to change them two, there are lots of links to the sort manuals including at the top of this page, plus the "stickies", the postings at the top of this list.

Unless you want to do calculation with them, though, why do you insist that they should be numeric? PIC X is a fine definition for them, saves the compiler generating little bits a code you don't know about (generate the pseudo-assembler listing with PIC 9, and you will know) but won't need.
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 -> DFSORT/ICETOOL 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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
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 Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am


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