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
 

 

Icetool input file which is variable length f

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Icetool input file which is variable length f
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 Moderator


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

PostPosted: Wed Apr 16, 2008 9:44 pm    Post subject:
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    Post subject: Reply to: Icetool input file which is variable length f
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    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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


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