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
 

 

Reproduce a field in other records

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

New User


Joined: 12 Dec 2005
Posts: 27
Location: Belgium

PostPosted: Mon Nov 27, 2006 9:59 pm    Post subject: Reproduce a field in other records
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 Moderator


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

PostPosted: Mon Nov 27, 2006 10:24 pm    Post subject:
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: 27
Location: Belgium

PostPosted: Tue Nov 28, 2006 2:59 pm    Post subject: Re: Reproduce a field in other records
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 Moderator


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

PostPosted: Tue Nov 28, 2006 9:24 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

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:

http://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: 27
Location: Belgium

PostPosted: Tue Nov 28, 2006 10:49 pm    Post subject: Re: Reproduce a field in other records
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    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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


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