Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 103
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 Remove all Parenthetical Statements -... JayaprakashT DB2 2 Fri Apr 27, 2018 3:57 am
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts write multiple lines in PS file in cobol Balu5491 COBOL Programming 7 Wed Mar 07, 2018 10:27 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us