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
 
Break the line depending upon condition

 
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: Mon Mar 16, 2009 7:49 pm    Post subject: Break the line depending upon condition
Reply with quote

Hi all,

I am having an input file of Lrecl 7000.

I need to copy the content of the files to another of lrecl = 1000.

SO while copying the record i need to split a single record of the source file into multiple records in the destination file of lrecl = 1000 depending upon wether the string "<CELL>" is present or not ??

For example

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+-
language developed <CELL> for commercial <CELL> application
asdasd <CELL> 12521376
dasd123456789
idruiswrn834284<CELL> sadasdadhfsw<CELL>


So my output should look like below,
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+-
language developed
for commercial
 application
asdasd
 12521376
dasd123456789
idruiswrn834284
 sadasdadhfsw


Could you guys please help me to achieve this through a sort card.
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: Mon Mar 16, 2009 8:57 pm    Post subject:
Reply with quote

You can use a DFSORT/ICETOOL job like the following. I assumed that you could have a maximum of 7 strings delimited by <CELL> in one line, but you can handle more by increasing the number of %nn fields appropriately. I also assumed that you wouldn't have any strings delimited by <CELL> that start with more than 50 blanks.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (FB/7000)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/1000)
//TOOLIN DD *
* Split input records into 1000 byte output records using
* <CELL> as a delimiter.
COPY FROM(IN) USING(CTL1)
* Remove blank lines.
COPY FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
   OPTION COPY
   OUTFIL FNAMES=T1,
    PARSE=(%01=(ENDBEFR=C'<CELL>',FIXLEN=1000),
           %02=(ENDBEFR=C'<CELL>',FIXLEN=1000),
           %03=(ENDBEFR=C'<CELL>',FIXLEN=1000),
           %04=(ENDBEFR=C'<CELL>',FIXLEN=1000),
           %05=(ENDBEFR=C'<CELL>',FIXLEN=1000),
           %06=(ENDBEFR=C'<CELL>',FIXLEN=1000),
           %07=(FIXLEN=1000)),
     BUILD=(%01,/,%02,/,%03,/,%04,/,%05,/,%06,/,%07)
/*
//CTL2CNTL DD *
  OMIT COND=(1,50,CH,EQ,C' ')
/*
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Tue Mar 17, 2009 7:35 pm    Post subject: Reply to: Break the line depending upon condition
Reply with quote

Hi Frank,

Thank you very much.
I just chage a bit as per my requirement and it works fine.
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 Splitting one row into multiple Rows ... Rajan Moorthy DFSORT/ICETOOL 9 Mon May 14, 2018 10:58 pm
No new posts Detect break in the sequence tuxama DFSORT/ICETOOL 6 Tue Mar 20, 2018 1:35 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am

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