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
 

 

Split string x(255) into n parts of x(40) using sort

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

New User


Joined: 11 Jun 2009
Posts: 8
Location: Atlanta, GA

PostPosted: Mon Jun 22, 2009 3:12 pm    Post subject: Split string x(255) into n parts of x(40) using sort
Reply with quote

I/P RECFM=FB AND LRECL=260

Fields:
Line_nbr pic 9(7).
Notes pic x(253).

Input file :
Code:
Line_nbr Notes 
       1 AAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
       2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
       3 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
       4 DDDDDDDDDDDDDDDDDDDDD  DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
       5 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT


Need to split the Notes of pic x(253) into n parts of x(40) based on the content in the Notes. seq_nbr inserted between Line_nbr and Notes to differentiate it.

O/P RECFM=FB, LRECL=50
Fields:
Line_nbr pic 9(7).
Seq_nbr pic 9(3).
Notes pic x(40).

o/p file :

Code:
Line_nbr Seq_nbr Notes 
       1     1   AAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
       1     2   AAAAAAAAAAAAAAAAAAAAAAAAA
       2     1   BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
       2     2   BBBBBBBBBBBBBBBBB
       3     1   CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
       4     1   DDDDDDDDDDDDDDDDDDDDD  DDDDDDDDDDDDDDDDD
       4     2   DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
       5     1   TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
       5     2   TTTTTTTTT


Thanks
Denny
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 Jun 22, 2009 9:52 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (FB/260)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/50)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) TO(OUT) USING(CTL2)
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,
    BUILD=(1,7,C'  1',8,40,/,
           1,7,C'  2',48,40,/,
           1,7,C'  3',88,40,/,
           1,7,C'  4',128,40,/,
           1,7,C'  5',168,40,/,
           1,7,C'  6',208,40,/,
           1,7,C'  7',248,13)
/*
//CTL2CNTL DD *
  OMIT COND=(11,40,CH,EQ,C' ')
/*
Back to top
View user's profile Send private message
archer_denny

New User


Joined: 11 Jun 2009
Posts: 8
Location: Atlanta, GA

PostPosted: Tue Jun 23, 2009 1:47 pm    Post subject: Reply to: Split string x(255) into n parts of x(40) using so
Reply with quote

it works... Thanks Frank

Thanks
Denny
"The / (0 blank lines) in the middle is used to create two output records from each input record".
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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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