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

Compare the fields from 2 records using DFSORT


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

PostPosted: Fri Aug 03, 2007 12:13 pm
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
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
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
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 Developer


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

PostPosted: Fri Aug 03, 2007 8:50 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top