View previous topic :: View next topic
Author
Message
Jeanne Kornkven New User Joined: 25 May 2007Posts: 4 Location: Milwaukee, WI
My output needs to be reformatted. It looks like this:
Code:
DEPT CLASS VENDOR SKU TYPE RETAIL COST UNITS
---- ----- ---------- ------------- ---- --------------- --------------- ----------------
0014 002 0140099997 9999999999999 M002 8.99 0.00 0
0016 002 0160099997 9999999999999 I002 0.11 0.00 0
0016 628 0160099997 9999999999999 I002 0.15 0.00 0
0016 002 0160099997 9999999999999 M041 1.50 0.00 0
0016 628 0160099997 9999999999999 M041 1.95 0.00 0
0016 002 0160099997 9999999999999 S001 8.49 0.00 1
0016 628 0160099997 9999999999999 S001 11.04 0.00 1
0016 002 0160099997 9999999999999 S004 8.49 0.00 1
0016 628 0160099997 9999999999999 S004 11.04 0.00 1
I need it to look like this:
Code:
SIF_DPT SIF_CLS VEND SKU SIF_TYPE SIF_RETAIL SIF_COST SIF_UNITS
------- ------- ---- --- -------- ---------- -------- ---------
0014 002 0140099997 9999999999999 M002 8.99 .00 0
0016 002 0160099997 9999999999999 I002 .11 .00 0
M041 1.50 .00 0
S001 8.49 .00 1
S004 8.49 .00 1
628 0160099997 9999999999999 I002 .15 .00 0
M041 1.95 .00 0
S001 11.04 .00 1
S004 11.04 .00 1
In other words, only print the dept, cls, vend, and sku fields when they change.
Code:
COUNT FROM(OUT1) EMPTY RC4
DISPLAY FROM(OUT1) LIST(OFFLINE) -
TITLE('VA DEPT/VEND NOT IN WALKER FILE (TRMS=VAVNDEXC)') -
DATE TIME PAGE -
HEADER('DEPT') ON(28,04,CH) -
HEADER('CLASS') ON(32,03,CH) -
HEADER('VENDOR') ON(55,10,CH) -
HEADER('SKU') ON(72,13,CH) -
HEADER('TYPE') ON(1,4,CH) -
HEADER('RETAIL') ON(99,6,PD,C1,N10) -
HEADER('COST') ON(105,6,PD,C1,N08) -
HEADER('UNITS') ON(111,4,BI,A0) -
BREAK(25,03,CH) BTITLE('COMPANY') -
STATLEFT -
TOTAL('TOTAL')
*
The code above is what I am using. Do I need to implement SEQNUMs for each field and overlay with spaces in an IFTHEN?? Am I on the right track?
Thanks for your help.
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello and welcome to the forums
How is the data that needs to be reformatted created initially?
Back to top
Jeanne Kornkven New User Joined: 25 May 2007Posts: 4 Location: Milwaukee, WI
This is a sequential file of records that are rejected by a COBOL program. I just need to format the rejected records so the user can make sense of them.
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Is it possible that the rejects could be put into a data file without the headers and editing?
From your example, not only is some suppression wanted, but the data is now in a different sequence. Originally, the 002 and 628 entries are interleaved, but in the desired output, theu are placed together.
I believe this "data" file would be easier to use for the report generation you want.
Back to top
Jeanne Kornkven New User Joined: 25 May 2007Posts: 4 Location: Milwaukee, WI
I need to clarify: the first example is my output. The second is my desired output. The input is, indeed in data file. I'll need a sort.
M00205/23/200705/23/2007005001400200000000000000000000014009999799999999999999999999015305/23/2007....i?..........
I00205/23/200705/23/2007005001600200000000000000000000016009999799999999999999999999044005/23/2007................
I00205/23/200705/23/2007005001662800000000000000000000016009999799999999999999999999043705/23/2007.....*..........
M04105/23/200705/23/2007005001600200000000000000000000016009999799999999999999999999044005/23/2007................
M04105/23/200705/23/2007005001662800000000000000000000016009999799999999999999999999043705/23/2007.....*..........
S00105/23/200705/23/2007005001600200000000000000000000016009999799999999999999999999044005/23/2007....d?..........
S00105/23/200705/23/2007005001662800000000000000000000016009999799999999999999999999043705/23/2007.....<..........
S00405/23/200705/23/2007005001600200000000000000000000016009999799999999999999999999044005/23/2007....d?..........
S00405/23/200705/23/2007005001662800000000000000000000016009999799999999999999999999043705/23/2007.....<..........
Back to top
Jeanne Kornkven New User Joined: 25 May 2007Posts: 4 Location: Milwaukee, WI
I have it working. This does seem like the long way around, however, is there a simpler method? I was hoping for something simpler.
Code:
//CTL1CNTL DD *
SORT FIELDS=(25,03,CH,A,
28,04,CH,A,
32,03,CH,A,
55,10,CH,A,
72,13,CH,A,
1,4,CH,A)
OUTREC IFTHEN=(WHEN=INIT,BUILD=(01,114,
115:SEQNUM,4,ZD,RESTART=(28,04),
119:SEQNUM,4,ZD,RESTART=(32,03),
123:SEQNUM,4,ZD,RESTART=(55,10),
127:SEQNUM,4,ZD,RESTART=(72,13))),
IFTHEN=(WHEN=(115,04,CH,NE,C'0001'),OVERLAY=(28:4X),HIT=NEXT),
IFTHEN=(WHEN=(119,04,CH,NE,C'0001',AND,
115,04,CH,NE,C'0001'),OVERLAY=(32:4X),HIT=NEXT),
IFTHEN=(WHEN=(123,04,CH,NE,C'0001',AND,
119,04,CH,NE,C'0001',AND,
115,04,CH,NE,C'0001'),OVERLAY=(55:10X),HIT=NEXT),
IFTHEN=(WHEN=(127,04,CH,NE,C'0001',AND,
123,04,CH,NE,C'0001',AND,
119,04,CH,NE,C'0001',AND,
115,04,CH,NE,C'0001'),OVERLAY=(72:13X),HIT=NEXT)
OUTFIL FNAMES=OUT1,BUILD=(01,114)
/*
//*
//TOOLIN DD *
SORT FROM(VASIF) TO(OUT1) USING(CTL1)
COUNT FROM(OUT1) EMPTY RC4
DISPLAY FROM(OUT1) LIST(RPT1) -
TITLE('VA DEPT/VEND NOT IN WALKER FILE (TRMS=VAVNDEXC)') -
DATE TIME PAGE -
HEADER('DEPT') ON(28,04,CH) -
HEADER('CLASS') ON(32,03,CH) -
HEADER('VENDOR') ON(55,10,CH) -
HEADER('SKU') ON(72,13,CH) -
HEADER('TYPE') ON(1,4,CH) -
HEADER('RETAIL') ON(99,6,PD,C1,N10) -
HEADER('COST') ON(105,6,PD,C1,N08) -
HEADER('UNITS') ON(111,4,BI,A0) -
BREAK(25,03,CH) BTITLE('COMPANY') -
STATLEFT -
TOTAL('TOTAL')
/*
Thanks,
Jeanne
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Good to hear that it is working
Your solution may be the "simple" way with DFSORT. . . .
Back to top
Please enable JavaScript!