IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Repeat n times by substuting SEQNUM in CBL CPY variables set


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
justjpr

New User


Joined: 03 Nov 2022
Posts: 30
Location: INDIA

PostPosted: Sun Sep 29, 2024 11:27 am
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2123
Location: USA

PostPosted: Sat Oct 05, 2024 12:00 am
Reply with quote

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 icon_smile.gif

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1312
Location: Vilnius, Lithuania

PostPosted: Sat Oct 05, 2024 3:47 pm
Reply with quote

Quote:
If all you have is a hammer, everything looks like a nail


'nuff said...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts Preserve changes to ISPF Panel Variables TSO/ISPF 1
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts Repeat a DD line- comment and insert ... CA Products 3
No new posts JCL with variables JCL & VSAM 1
Search our Forums:

Back to Top