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

Need to move 4 characters after the position 249


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
preethan
Warnings : 1

New User


Joined: 15 Dec 2008
Posts: 33
Location: Chennai

PostPosted: Wed Jan 19, 2011 5:07 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Jan 19, 2011 6:43 am
Reply with quote

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
View user's profile Send private message
preethan
Warnings : 1

New User


Joined: 15 Dec 2008
Posts: 33
Location: Chennai

PostPosted: Wed Jan 19, 2011 6:56 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Jan 19, 2011 7:13 am
Reply with quote

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
View user's profile Send private message
preethan
Warnings : 1

New User


Joined: 15 Dec 2008
Posts: 33
Location: Chennai

PostPosted: Wed Jan 19, 2011 7:25 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Jan 19, 2011 7:28 am
Reply with quote

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
View user's profile Send private message
preethan
Warnings : 1

New User


Joined: 15 Dec 2008
Posts: 33
Location: Chennai

PostPosted: Wed Jan 19, 2011 7:33 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Jan 19, 2011 7:39 am
Reply with quote

Hi,

try this
Code:
  OUTREC IFTHEN=(WHEN=(244,2,CH,EQ,C'79'),                         
         OVERLAY=(304:254,4,254:C'    '))                       



Gerry
Back to top
View user's profile Send private message
preethan
Warnings : 1

New User


Joined: 15 Dec 2008
Posts: 33
Location: Chennai

PostPosted: Wed Jan 19, 2011 7:50 am
Reply with quote

Hi Gerry,

Thanks a lot.. its working fine now..Thanks for your patience
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: Thu Jan 20, 2011 12:14 am
Reply with quote

Just one nit. I would suggest using 254:4X or 254:4C' ' or 254:4X'40' instead of

Code:

254:C'    ' 


to make it obvious how many blanks are being used.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top