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
 

 

Compare the fields from 2 records using DFSORT

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

New User


Joined: 04 Jan 2007
Posts: 23
Location: Chennai

PostPosted: Fri Aug 03, 2007 11:34 am    Post subject: Compare the fields from 2 records using DFSORT
Reply with quote

Hi
My requirement is I have a file of lrecl 81.The adjacent records have to be compared.i.e if the first record has '>>'in pos '1' and the second record
has 'null' in pos '2' we have to append the second record with the sequence number.then for 2nd and 3rd record.Thus the check has to be repeated for the entire file..
Can we do this in SORT or I have to choose COBOL?
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Aug 03, 2007 12:13 pm    Post subject:
Reply with quote

Saradha,

Quote:
Can we do this in SORT or I have to choose COBOL?

I feel COBOL is the best option, unless Frank comes up with radical solution.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Aug 03, 2007 3:27 pm    Post subject:
Reply with quote

Saradha Ramalingam
Can you elaborate your requirment with the i/p and o/p file details!

With sample set of i/p and o/p records, with RECFM and LRECL
Back to top
View user's profile Send private message
karisurya

New User


Joined: 02 Aug 2007
Posts: 64
Location: Bangalore

PostPosted: Fri Aug 03, 2007 3:48 pm    Post subject: Re: Compare the fields from 2 records using DFSORT
Reply with quote

It will be easy to solve if u can give some example of your i/p and expected output. The description is not very clear.
Back to top
View user's profile Send private message
Saradha Ramalingam

New User


Joined: 04 Jan 2007
Posts: 23
Location: Chennai

PostPosted: Fri Aug 03, 2007 5:51 pm    Post subject: Re: Compare the fields from 2 records using DFSORT
Reply with quote

i/p file

Code:

»           000000!  Ly®   00010671    00010671  ý F2A10110 a
            000001!  LyI
            000002!  L¿«       e T1V10500  f C0H20090
            000003! ¯LÓÓ    ©L£«           X0H2109C
»           000004!  Lw®           }  \  µ
            000005!  L£º           }  \
            000006!  LzI
            000007! äLµ°       MRP0MRCHM2    0601101027038254MA
            000008!  Lµ°       MRP0MRCHMI    0601101027038254MA
            000009!  Lµ°       MRP0MRCHMI    0601101027038254MA


o/p file

Code:

            0000001          000001!  LyI
            000001            000002!  L¿«       e T1V10500
            000002            000003! ¯LÓÓ    ©L£«
            000003            000005!  L£º           }  \
            000004            000006!  LzI
            000005            000007! äLµ°       MRP0MRCHM2
            000006            000008!  Lµ°       MRP0MRCHMI
            000007            000009!   Lµ°       MRP0MRCHMI


If the first record has » and the second record has null in the 2nd pos the
first record wil be deleted and the second record will be appended with the
sequence number and '1' will be appended with 8 spaces.If the condition is not satisfied then only the sequence number will be appended. Do you need any further information?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Aug 03, 2007 8:50 pm    Post subject:
Reply with quote

I put in code tags to get the input closer to what you wanted it to look like but I don't know if I got the alignment of fields correct.

What do you mean by null? X'00' or something else?

Quote:
'1' will be appended with 8 spaces


I don't understand what you mean by this. You deleted record 0 and added sequence number 000000 followed by a '1'. But you deleted record 4 and added sequence number 000003 but did not follow that with a '1'. Why the difference? And what about the 8 spaces? Are 000001! and 000002! supposed to start in different positions?

Perhaps a few more examples of >> records for input and the resulting output would help.

And please use code tags where appropriate.
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 member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
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 Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm


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