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

Adding a header when change data


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

New User


Joined: 03 Jul 2014
Posts: 28
Location: Italy

PostPosted: Fri Sep 03, 2021 10:11 pm
Reply with quote

Hi all.
i have an input file like this:
Code:

AAAAAA   11111111 222222222
AAAAAA   33333333 444444444
BBBBBB   11111111 555555555
CCCCCC   77777777 888888888



I need to create an output file entering an header everytime data change like this:

Code:

col1     col2     col3
AAAAAA   11111111 222222222
AAAAAA   33333333 444444444

col1     col2     col3
BBBBBB   11111111 555555555

col1     col2     col3
CCCCCC   77777777 888888888


including the blank line.

Is it possible to do with a jcl ?

Thank you.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Sat Sep 04, 2021 12:50 am
Reply with quote

No, you need a program.
JCL is for allocating resources and initiating programs.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2011
Location: USA

PostPosted: Sat Sep 04, 2021 3:56 am
Reply with quote

It is not possible in JCL.

It is possible when using:
1) SYNCSORT or DFSORT utilities
2) code in REXX
3) code in COBOL
4) code in C/C++
……..
100500) code in almost any programming language, or tool.

JCL is the only one language which cannot do what you need.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Sat Sep 04, 2021 6:23 am
Reply with quote

Please post under right section of the forum .
If you know DFSORT/SYNCSORT then think about this approach.
www.ibmmainframeforum.com/dfsort-icetool-icegener/topic6441.html
ibmmainframes.com/about60729.html

If you do little more search you may get more similar results and then give a little twist as per your need and try. If you still face issues let us know we would try to help.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1231
Location: Bamberg, Germany

PostPosted: Sat Sep 11, 2021 10:25 am
Reply with quote

I guess that we will not see a solution from the TS here. It should look like this:
Code:
//WHATEVER EXEC PGM=ICEMAN
//SORTIN   DD *                                         
AAAAAA   11111111 222222222                             
AAAAAA   33333333 444444444                             
BBBBBB   11111111 555555555                             
CCCCCC   77777777 888888888                             
/*                                                     
//SYSOUT   DD SYSOUT=*                                 
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  OPTION COPY                                           
  OUTFIL FNAMES=(SORTOUT),                             
    REMOVECC,                                           
    SECTIONS=(1,6,SKIP=1L,                             
      HEADER3=(1:C'Col1',10:C'Col2',19:C'Col3')),       
    BUILD=(1,80)                                       
  END                                                   
/*

Output:
Code:
****** ****************************
000001 Col1     Col2     Col3     
000002 AAAAAA   11111111 222222222
000003 AAAAAA   33333333 444444444
000004                             
000005 Col1     Col2     Col3     
000006 BBBBBB   11111111 555555555
000007                             
000008 Col1     Col2     Col3     
000009 CCCCCC   77777777 888888888
****** ****************************
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2011
Location: USA

PostPosted: Sat Sep 11, 2021 11:06 pm
Reply with quote

As a fool-proof, the SORT on SECTIONS columns needs to be added, I guess.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1231
Location: Bamberg, Germany

PostPosted: Tue Sep 14, 2021 9:10 am
Reply with quote

sergeyken wrote:
As a fool-proof, the SORT on SECTIONS columns needs to be added, I guess.

I had that in my test case. icon_smile.gif
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 Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Check data with Exception Table DB2 0
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top