Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Populate a filed in other records basing on key

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

New User


Joined: 16 Nov 2006
Posts: 3

PostPosted: Thu Feb 01, 2007 6:12 pm    Post subject: Populate a filed in other records basing on key
Reply with quote

Hi all,

I have a flat file with following attributes. My requirement is to repeat a particular field (CODE - for layout refer below) available in one of the record basing on key value.

Lrecl = 80; recfm=FB

File Layout:

Key pic x(12)
filler pic x
alpha pic x(03)
filler pic x
date pic 9(6) in yymmdd format
filler pic x
total pic 9(11)V99
filler pic x
code pic x(7)

IP Sample data:
Code:

123705849CMT CMB 021016 000000136.93
123705849CMT CMB 021016 000000136.93
123705849CMT CMB 021016 000000136.93 JE3 4D
123747225CMT CMW 030306 000000123.75
123747225CMT CMW 030306 000000123.75
123747225CMT CMW 030306 000000123.75
123747225CMT CMW 030306 000000123.75
123747225CMT CMW 030306 000000123.75 JE2 3L
123779237CCI CEL 030615 000000401.85 GY1 1Q




Out file should look like

123705849CMT CMB 021016 000000136.93 JE3 4D
123705849CMT CMB 021016 000000136.93 JE3 4D
123705849CMT CMB 021016 000000136.93 JE3 4D
--------------- end of key 1 -------------
123747225CMT CMW 030306 000000123.75 JE2 3L
123747225CMT CMW 030306 000000123.75 JE2 3L
123747225CMT CMW 030306 000000123.75 JE2 3L
123747225CMT CMW 030306 000000123.75 JE2 3L
123747225CMT CMW 030306 000000123.75 JE2 3L
-------- end of key 2----------------
123779237CCI CEL 030615 000000401.85 GY1 1Q
---------- end of key 3----------
and so on so forth

Note: As of now, filelds marked in red colour of output file was getting printed and blue colour is the one which I want to repeat basing on a key.

Regards,
Latha
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: Thu Feb 01, 2007 10:06 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed the "code" value you want to propagate is in the last record with each key as shown in your example.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file (FB/44)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//    DD DSN=*.IN,VOL=REF=*.IN,DISP=(OLD,PASS)
//OUT DD DSN=...  output file (FB/44)
//TOOLIN DD *
SELECT FROM(IN) TO(T1) ON(1,12,CH) LAST
SPLICE FROM(CON) TO(OUT) ON(1,12,CH) -
  WITHALL WITH(1,37)
/*
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 MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us