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
 

 

Need to move 4 characters after the position 249

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need to move 4 characters after the position 249
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: 1703
Location: Australia

PostPosted: Wed Jan 19, 2011 6:43 am    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Jan 19, 2011 7:13 am    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Jan 19, 2011 7:28 am    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Jan 19, 2011 7:39 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Jan 20, 2011 12:14 am    Post subject:
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    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 Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm


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