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

Assigning particular numbers to a field using sort overlay


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1742
Location: Tirupur, India

PostPosted: Mon Jul 04, 2011 10:56 am
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: 1742
Location: Tirupur, India

PostPosted: Mon Jul 04, 2011 11:01 am
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
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: 1742
Location: Tirupur, India

PostPosted: Mon Jul 04, 2011 11:42 am
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jul 04, 2011 11:42 am
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 04, 2011 12:22 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 04, 2011 12:44 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top