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

Reproduce a field in other records


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

New User


Joined: 12 Dec 2005
Posts: 29
Location: Belgium

PostPosted: Mon Nov 27, 2006 9:59 pm
Reply with quote

Hi, i need to reproduce a field from the header of a section in all records of the section.

Ex file in :
ABCD fieldA 11111111111111111111111111111111111

BBBBBB
CCCCCC
DDDDDD

ABCD fieldB 222222222222222222222222222222222222

EEEEEE
FFFFFFF

ABCD Fieldd 4444444444444444444444444444444444444

GGGGG


and i need as output:

fielda BBBBBB
fielda CCCCCC
fielda DDDDDD
fieldb EEEEEE
fieldb FFFFFF
fieldd GGGGGG

Could anybody help me to solution my problem with Dfsort ?

Many thanks beforhands,
best regards, Michel
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: Mon Nov 27, 2006 10:24 pm
Reply with quote

Does 'ABCD' in positions 1-4 identify the header record? If not, what identifies the header record? What is the RECFM and LRECL of the input file? What is the starting position and length of the field in the header record you want to propagate?
Back to top
View user's profile Send private message
mgl

New User


Joined: 12 Dec 2005
Posts: 29
Location: Belgium

PostPosted: Tue Nov 28, 2006 2:59 pm
Reply with quote

Hi Frank,
First of all many thanks for your interest.
yes, ABCD is the record header, for the DCB, let say RECFM FB LRECL 80.
The field i try to propagade is at offset 6 length 8 .

My first idea was to modify records with inrec ifthen (place a seqnum value for abcd records) and to propagate this value using outrec. With ifthen ABCD , i define %01 pointing to seqnum value, and i use this "kind variable" for build in an ifthen fitring other records. But i received a msgICE245A field not defined for htis ifthen.
My problem is to have a key in order to splice.

Best regards,
Michel
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: Tue Nov 28, 2006 9:24 pm
Reply with quote

Michel,

Here's a DFSORT/ICETOOL job that will do what you asked for. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use INREC with SPLICE. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

Use [URL] BBCode for External Links

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB/80)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(81,8,ZD) -
  WITHALL WITH(10,6) USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,4,CH,EQ,C'ABCD'),
                BUILD=(1:6,8,81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(10:1,6,89:SEQNUM,8,ZD,
                         81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
  OUTFIL FNAMES=OUT,BUILD=(1,80)
/*


For more information on this DFSORT "group" technique, see the "Include or omit groups of records" and "Sort groups of records" Smart DFSORT Tricks at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
mgl

New User


Joined: 12 Dec 2005
Posts: 29
Location: Belgium

PostPosted: Tue Nov 28, 2006 10:49 pm
Reply with quote

Hi Frank,

Great as usual. It is just what i need and it is working fine.

I thank you a lot, have a nice day,
Michel.
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 only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top