IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

regarding sectioning


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vyasricha

New User


Joined: 17 Mar 2008
Posts: 27
Location: banaglore

PostPosted: Wed Apr 16, 2008 6:45 pm
Reply with quote

Hi,

This is a part of one requirement, if this part is done I can proceed for the
rest of the solution.
I have an input file with many sections
each section starts with word Header in the first column

Header
aaa
bbb
ccc
ddd
Header
eee
fff
ggg
Header
hhh
iii

I want to introduce a new feild in the first column
which specifies the section no.
so, the output should look like this

1Header
1aaa
1bbb
1ccc
1ddd
2Header
2eee
2fff
2ggg
3Header
3hhh
3iii
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Apr 16, 2008 10:38 pm
Reply with quote

What is the RECFM and LRECL of the input file?

Is the header record identified by 'Header' in positions 1-6? If not, how is it identified exactly?

What do you want for the length and format of the inserted section (1 byte is only going to get you up to 9 sections)?
Back to top
View user's profile Send private message
vyasricha

New User


Joined: 17 Mar 2008
Posts: 27
Location: banaglore

PostPosted: Thu Apr 17, 2008 8:20 am
Reply with quote

Hi,
Just assume that max no of sections is only 9
Format of the file is FB of length 80
header is identified by HEADER key word from 1st column of a row
Back to top
View user's profile Send private message
vyasricha

New User


Joined: 17 Mar 2008
Posts: 27
Location: banaglore

PostPosted: Thu Apr 17, 2008 1:44 pm
Reply with quote

This is part of another post
'Icetool input file which is variable length'

I have got solution over there.

Thanks
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Apr 17, 2008 10:11 pm
Reply with quote

vyasricha,

The following DFSORT JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICEMAN                           
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                       
HEADER                                               
AAA                                                   
BBB                                                   
CCC                                                   
DDD                                                   
HEADER                                               
EEE                                                   
FFF                                                   
GGG                                                   
HEADER                                               
HHH                                                   
III                                                   
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
  INREC IFTHEN=(WHEN=INIT,                           
       OVERLAY=(81:SEQNUM,8,ZD)),                     
        IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),           
       OVERLAY=(81:SEQNUM,8,ZD)),                     
        IFTHEN=(WHEN=NONE,                           
       OVERLAY=(89:SEQNUM,8,ZD,                       
                81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
                                                     
  SORT FIELDS=COPY                                   
  OUTREC BUILD=(88,1,1,79)                           
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Search our Forums:

Back to Top