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
 

 

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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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