View previous topic :: View next topic
|
Author |
Message |
justjpr
New User
Joined: 03 Nov 2022 Posts: 33 Location: INDIA
|
|
|
|
Code: |
//STEP010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
COPY FROM(T1) TO(OUT)
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(1,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//IN1 DD *
196300 05 W-K1-SEGMENT-NN
196500 10 W-SEG-ID-NN PIC X(2).
196600 10 W-P-IND-NN PIC 9(1).
196700 10 W-NAME-NN PIC X(30).
196800 10 FILLER-NN PIC X(1).
/*
//CTL1CNTL DD *
OUTFIL FINDREP=(INOUT=(C'-NN',C'-01'))
/*
//CTL2CNTL DD *
OUTFIL FINDREP=(INOUT=(C'-NN',C'-02'))
/*
|
i/p :
Code: |
196300 05 W-K1-SEGMENT-NN
196500 10 W-SEG-ID-NN PIC X(2).
196600 10 W-P-IND-NN PIC 9(1).
196700 10 W-NAME-NN PIC X(30).
196800 10 FILLER-NN PIC X(1).
|
o/p :
Code: |
196300 05 W-K1-SEGMENT-01
196500 10 W-SEG-ID-01 PIC X(2).
196600 10 W-P-IND-01 PIC 9(1).
196700 10 W-NAME-01 PIC X(30).
196800 10 FILLER-01 PIC X(1).
196300 05 W-K1-SEGMENT-02
196500 10 W-SEG-ID-02 PIC X(2).
196600 10 W-P-IND-02 PIC 9(1).
196700 10 W-NAME-02 PIC X(30).
196800 10 FILLER-02 PIC X(1).
|
This is tested successfully.
My actual requirement is to repeat the cobybook lines N times. normally I need it for 5 times to 40 times depending on the occurs clause (OCCURS clause is not supported by Delphix). Defining 40 CNTLs is not a optimal solution. I hope ICETOOL/DFSORT has the capability to do it.
The snippet of the actual copybook is:
Code: |
196300 05 W-K1-SEGMENT OCCURS 0 TO 35 TIMES
196400 DEPENDING ON W-K1-COUNT.
196500 10 W-SEG-ID PIC X(2).
196600 10 W-P-IND PIC 9(1).
196700 10 W-NAME PIC X(30).
196800 10 FILLER PIC X(1).
|
To begin with this requirement, I customized the actual i/p, and achieved a bit.
I know I can do it in ReXX. But I love to do it in SORT/ICETOOL. Moreover a small portion of the requirement works  |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2209 Location: USA
|
|
|
|
justjpr wrote: |
I know I can do it in ReXX. But I love to do it in SORT/ICETOOL. Moreover a small portion of the requirement works  |
Since COBOL syntax is too flexible, a syntax parser is needed similar to the one included into COBOL compiler. It can be done, and once I had created two or three versions of it in ancient times (to convert COBOL copybooks to SYMNAMES layout for SORT-based file processing).
It makes sense only when there are hundred(s) of copybooks to be converted, but with some limitations on allowed COBOL coding rules. It took serious time to code it in REXX, but in SORT it would require 10 times more efforts - hence there is no reason to go for SORT.
I guess, for the mentioned task the total number of copybooks requiring such transformation is no more than 10 or 20, isn't it? In this case the manual conversion of 10-20 copybooks in ISPF editor, or any other standard tool, may require 50-100 less time than coding this converter in REXX, and 100-1000 times less time than coding it in SORT.
This is my own opinion. |
|
Back to top |
|
 |
prino
Senior Member

Joined: 07 Feb 2009 Posts: 1318 Location: Vilnius, Lithuania
|
|
|
|
Quote: |
If all you have is a hammer, everything looks like a nail |
'nuff said... |
|
Back to top |
|
 |
|
|