View previous topic :: View next topic
|
Author |
Message |
preethan Warnings : 1 New User
Joined: 15 Dec 2008 Posts: 33 Location: Chennai
|
|
|
|
Hi,
I am kinda new to DFSORT. Ok i come straight to the problem
My file is like this
----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+-
79B000000002130
78B000000002130
79B000000002155
76B000000002332
79B000000002153
Now i need to move 4 characters after the position 249 to 300. The new field is also of 4 characters. Please note that, only the records which starts with 79 should undergo this change.
The output should be like this
----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+-
79B00000000 2130
78B000000002130
79B00000000 2155
76B000000002332
79B00000000 2153
The records which start with '79' should have the change as above. Here it is not diplayed correctly the new position should start at the position 300. Also none of the other records than 79 should be affected.
Please help me, Im in an urgent need. Thanks very much for your help!!
Warning: Do not use "URGENT" In Topic title, Title Edited |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
what happens to the URGENT if you get no assistance from this forum.
Quote: |
Now i need to move 4 characters after the position 249 to 300 |
This makes no sense to me. What 4 characters and where exactly are the 4 characters to be placed ?
What is the current input LRECL FB or VB, output LRECL FB/VB ?
Have you tried anything ?
Gerry |
|
Back to top |
|
|
preethan Warnings : 1 New User
Joined: 15 Dec 2008 Posts: 33 Location: Chennai
|
|
|
|
Hi Gerry,
Im sorry that this did not make any sense to you. I was in a hurry
The four characters are marked in bolded below
----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+-
79B000000002130
78B000000002130
79B000000002155
76B000000002332
79B000000002153
This needs to be moved to the position 300. The length is not going to change here.
Suppose the current position is 250:4
It needs to be moved to 300:4
Only the records which has '79' at 240th position needs to be moved. ( I have underlined the 79 here).
If you are not understanding my problem please let me know.
I just tried with the fieldmap utility in insy and it is working fine. Now i am in no hurry since i got the result already.But still I would like to know how that happens in DFSORT. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Preethan,
if I understood you correctly this may assist:-
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=input
//SORTOUT DD DSN=output
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(240,2,CH,EQ,C'79'),
OVERLAY=(300:250,4))
/*
|
I have left 250:4 as it was.
Gerry |
|
Back to top |
|
|
preethan Warnings : 1 New User
Joined: 15 Dec 2008 Posts: 33 Location: Chennai
|
|
|
|
Hi Gerry,,
Thanks for your help,
But the four characters still remain in the same position. The file which i am using is Variable block. I am not sure what is happening. I tried earlier with the same option, but i gave inrec instead, that time also it did not work!! |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
that was one of my questions FB or VB.
Change it to
Code: |
OUTREC IFTHEN=(WHEN=(244,2,CH,EQ,C'79'),
OVERLAY=(304:254,4))
|
Gerry |
|
Back to top |
|
|
preethan Warnings : 1 New User
Joined: 15 Dec 2008 Posts: 33 Location: Chennai
|
|
|
|
Hi Gerry,
I got it now. Since its a variable block i have to add four here. Its working fine but, one more thing, when i used this the original is also there. As per my requirement those four characters which were in the position earlier shouldnt be there. It should be spaces in the previous position . i.e., 250:4 |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
OUTREC IFTHEN=(WHEN=(244,2,CH,EQ,C'79'),
OVERLAY=(304:254,4,254:C' ')) |
Gerry |
|
Back to top |
|
|
preethan Warnings : 1 New User
Joined: 15 Dec 2008 Posts: 33 Location: Chennai
|
|
|
|
Hi Gerry,
Thanks a lot.. its working fine now..Thanks for your patience |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Just one nit. I would suggest using 254:4X or 254:4C' ' or 254:4X'40' instead of
to make it obvious how many blanks are being used. |
|
Back to top |
|
|
|