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

Need to remove semicolon from the first two lines.


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

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Tue Apr 21, 2009 11:10 am
Reply with quote

Hi all,

I am having a file of lrecl = 80.

input file :-
Code:

----+----1----+----2----+----3----+----4----+----5
12;      ; dfasda ;sdaadf;
45;   ;dadfadfsa;faffff;ffsdfsff;
sdad;asdadf;fafa;fafaf;asfasfa
;asdfadf;asfa;afa;fa
;asfaf;agfaf;afa;faf


OPUTPUT file :-
Code:

----+----1----+----2----+----3----+----4----+----5
12;        dfasda  sdaadf
45;    dadfadfsa faffff ffsdfsff
sdad;asdadf;fafa;fafaf;asfasfa
;asdfadf;asfa;afa;fa
;asfaf;agfaf;afa;faf


So the condition is it need to remove the semicolons in the first two line and after 3 rd column for those lines.
The rest of the lines hould not be touched.

I tried by giving ALTSEQ but i m not getting my required output.

Can anyone please help ?

Thanks in advance.
[/quote]
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Apr 21, 2009 11:27 am
Reply with quote

You can use the DFSORT job below..
Code:

//STEP0100 EXEC PGM=SORT         
//SYSOUT   DD SYSOUT=*           
//SORTIN   DD *                   
12;      ; DFASDA ;SDAADF;       
45;   ;DADFADFSA;FAFFFF;FFSDFSFF;
SDAD;ASDADF;FAFA;FAFAF;ASFASFA   
;ASDFADF;ASFA;AFA;FA             
;ASFAF;AGFAF;AFA;FAF             
/*                               
//SORTOUT  DD SYSOUT=*           
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),     
        IFTHEN=(WHEN=(81,8,ZD,LE,2),                     
           FINDREP=(IN=C';',OUT=C' ',STARTPOS=4))       
  OUTREC BUILD=(1,80)                                           
/*                                                       
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Apr 21, 2009 12:56 pm
Reply with quote

Hi,

if you want to use ALTSEQ you can use the following DFSORT control statements:

Code:
 
  SORT FIELDS=COPY                                 
  ALTSEQ CODE=(5E40)                               
  INREC IFOUTLEN=80,                               
    IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),   
    IFTHEN=(WHEN=(81,8,ZD,LE,2),                   
      OVERLAY=(4:4,77,TRAN=ALTSEQ))                 


Gerry
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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Remove leading zeroes SYNCSORT 4
No new posts I need a 4 lines block where substrin... DFSORT/ICETOOL 12
No new posts Copy few lines from SYSOUT of 10 mill... All Other Mainframe Topics 5
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
Search our Forums:

Back to Top