View previous topic :: View next topic
|
Author |
Message |
Saradha Ramalingam
New User
Joined: 04 Jan 2007 Posts: 23 Location: Chennai
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
|
karisurya
New User
Joined: 02 Aug 2007 Posts: 64 Location: Bangalore
|
|
|
|
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 |
|
|
Saradha Ramalingam
New User
Joined: 04 Jan 2007 Posts: 23 Location: Chennai
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|