Re: Combining Fields From Files Without COBOL Pgm?
From: Frank Yaeger (yaeger_at_us.ibm.com)
Date: 07/14/04
- Next message: WardKenR: "Re: IBM 1401"
- Previous message: docdwarf_at_panix.com: "Re: Combining Fields From Files Without COBOL Pgm?"
- In reply to: docdwarf_at_panix.com: "Combining Fields From Files Without COBOL Pgm?"
- Next in thread: JerryMouse: "Re: Combining Fields From Files Without COBOL Pgm?"
- Reply: JerryMouse: "Re: Combining Fields From Files Without COBOL Pgm?"
- Reply: docdwarf_at_panix.com: "Re: Combining Fields From Files Without COBOL Pgm?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 14 Jul 2004 12:49:17 -0700
docdwarf@panix.com wrote:
> All right... platform's an IBM mainframe, MVS (or whatever it is called
> nowadays) and standard utilities (e.g., SUPERC); utilities available are
> DFSORT and MAXBAT (no FileAid).
>
> I have two versions of a file (key = startpos 2, len 9, character
> ascending (actually SNN in display-numeric format), both containing the
> same number of records and the same keys. One is 240 characters long and
> contains just about everything I need, the other is 480 characters long
> and all I need from it is a single character (for each matched record)
> from pos 349 to make a new file consisting of the what-I-need records with
> this character added at pos 241.
>
> Writing a COBOL program to do this is none-too-difficult... but adding
> another program to the jobstream (with associated move-to-Prod overhead)
> is something I'd rather avoid.
>
> Given the situation and tools outlined - no SAS, no REXX or CLIST
> (knowledge of those tools on this site is minimal and their use is
> actively discouraged) - might anyone have an idea how to go about this or
> am I doomed to putting into Prod a program which consists, at its heart,
> of something akin to
>
> READ FILE1 INTO WK-FILE1-REC.
> READ FILE2 INTO WK-FILE2-REC.
> IF WK-FILE1-SSN = WK-FILE2-SSN
> MOVE WK-FILE1-REC TO WK-FILE3-MAIN-CHUNK
> MOVE WK-FILE2-POS-349 TO WK-FILE3-POS-241
> WRITE FILE3-REC FROM WK-FILE3-REC
> END-IF.
>
> ... ?
DD,
You said you have DFSORT, so here's a DFSORT/ICETOOL job that will do
what you want using the SPLICE operator. For complete information on
SPLICE, see:
http://www.storage.ibm.com/software/sort/mvs/uq90053/online/srtmutol.html#spl
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... FB/240 input file
//IN2 DD DSN=... FB/480 input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
// DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,PASS)
//OUT DD DSN=... FB/241 output file
//TOOLIN DD *
* IN1->T1: copy records and add blank in position 241
COPY FROM(IN1) TO(T1) USING(CTL1)
* IN2->T2: copy key and add byte from 349 in position 241
COPY FROM(IN2) TO(T2) USING(CTL2)
* T1/T2->OUT: Splice on key to add byte from 349 at
* position 241
SPLICE FROM(CON) TO(OUT) ON(2,9,CH) WITH(241,1)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,240,241:X)
/*
//CTL2CNTL DD *
OUTREC FIELDS=(2:2,9,241:349,1)
/*
- Next message: WardKenR: "Re: IBM 1401"
- Previous message: docdwarf_at_panix.com: "Re: Combining Fields From Files Without COBOL Pgm?"
- In reply to: docdwarf_at_panix.com: "Combining Fields From Files Without COBOL Pgm?"
- Next in thread: JerryMouse: "Re: Combining Fields From Files Without COBOL Pgm?"
- Reply: JerryMouse: "Re: Combining Fields From Files Without COBOL Pgm?"
- Reply: docdwarf_at_panix.com: "Re: Combining Fields From Files Without COBOL Pgm?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|