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 remove semicolon from the first two lines.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Tue Apr 21, 2009 11:10 am    Post subject: Need to remove semicolon from the first two lines.
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    Post subject:
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: 1703
Location: Australia

PostPosted: Tue Apr 21, 2009 12:56 pm    Post subject:
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    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 syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am
No new posts Remove header only knobi SYNCSORT 5 Mon Feb 15, 2016 10:42 pm
No new posts DFSORT split long VB lines efficiently BridgetBrackenbury DFSORT/ICETOOL 2 Fri Feb 12, 2016 5:10 am


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