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

Icetool input file which is variable length f


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 9:33 am
Reply with quote

The input file which is variable length file looks like this:

Code:

830H000 000      200803150114
830H000N001    200803150114  9263440
830L001 000      200803150114  BP6TABBB
830L000N001     200803150114 9204285X
830L001F001         200803150114 CCCC DDDD
830L001F002         200803150114 CCCC DDDD
830L001F003         200803150114 CCCC DDDD
830H000 000      200803150114  BP6TAAAA
830H000N001    200803150114  9263440
830L001 000      200803150114
830L000N001     200803150114 9204287
830L001F001         200803150114 AAAA BBBBB
830L001F002         200803150114 AAAA BBBBB
830L001F003         200803150114 AAAA BBBBB



This file has many sections, above example contains 2 sections, each section starts with ‘H000 000’ in the 4th column and 3 more header lines with H000N001, L001 000, L000N001 and detail line has ‘L001F00’
The requirement is to change H000N001 to H000N002
and shift L000N001 above the H000N001 and name it as H000N001in all the sections.

Output:

Code:

830H000 000      200803150114
830H000N001    200803150114 9204285X
830H000N002    200803150114  9263440
830L001 000      200803150114  BP6TABBB
830L001F001        200803150114 CCCC DDDD
830L001F002        200803150114 CCCC DDDD
830L001F003        200803150114 CCCC DDDD
830H000 000     200803150114  BP6TAAAA
830L000N001    200803150114 9204287
830H000N002   200803150114  9263440
830L001 000     200803150114
830L001F001        200803150114 AAAA BBBBB
830L001F002        200803150114 AAAA BBBBB
830L001F003        200803150114 AAAA BBBBB
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 9:44 pm
Reply with quote

I assumed that by "The input file which is variable length file" you mean that it has RECFM=VB, and that it's not actually a RECFM=FB file with different numbers of blanks at the end.

Assuming it is RECFM=VB, here's a DFSORT/ICETOOL job that will do what you asked for (if it's actually FB, the solution will be different a bit different):

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file (VB)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (VB)
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,21:C'5',22:5)),
        IFTHEN=(WHEN=INIT,OVERLAY=(5:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(25,8,CH,EQ,C'H000 000'),
                OVERLAY=(5:SEQNUM,8,ZD,21:C'1')),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(13:SEQNUM,8,ZD,
                         5:5,8,ZD,SUB,13,8,ZD,TO=ZD,LENGTH=8))
  OUTREC IFTHEN=(WHEN=(25,8,CH,EQ,C'H000N001'),
     OVERLAY=(21:C'3',25:C'H000N002')),
    IFTHEN=(WHEN=(25,8,CH,EQ,C'L001 000'),
     OVERLAY=(21:C'4')),
    IFTHEN=(WHEN=(25,8,CH,EQ,C'L000N001'),
     OVERLAY=(21:C'2',25:C'H000N001'))
/*
//CTL2CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(5,8,ZD,A,21,1,CH,A)
  OUTREC BUILD=(1,4,5:22)
/*
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 11:58 am
Reply with quote

Excellent solution
Thanks a lot
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

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top