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

Replace fields with spesific values from other records


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

New User


Joined: 14 Sep 2015
Posts: 6
Location: greece

PostPosted: Tue Sep 15, 2015 3:43 pm
Reply with quote

Hi
i need your help for this:
cola is the key and i need to put in colb(subkey) if it has spaces with the same value of previeus records
here is a example:

input file(fb)
cola(1,7) colb (8,3)

Code:
1234567aaa...................
1234567aaacccccccccccc
1234567   bbbbbbbbbb
2222222wwwfffffffffffffff
2222222   ddddddddd


output file :

Code:
1234567aaa...................
1234567aaacccccccccccc
1234567aaabbbbbbbbbb
2222222wwwfffffffffffffff
2222222wwwddddddddd



Thanks a lot.
[coded]
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Sep 15, 2015 3:49 pm
Reply with quote

Please use the code tags when presenting code and data - they retain the spacing that the browser would otherwise remove and makes you code/data stand out from your requirement text.

This is similar to many other requests - have you looked through this section of the forum?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Sep 15, 2015 4:36 pm
Reply with quote

Nic, not sure (yet) that it is so similar.

f1org, can your data be like this?

Code:

1234567aaa...................
1234567bbbcccccccccccc
1234567   bbbbbbbbbb
2222222wwwfffffffffffffff
2222222   ddddddddd
3333333   effffffffffffff
3333333   fdddddddd 
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Sep 15, 2015 4:57 pm
Reply with quote

If your data can be the more exotic example:
Code:

  OPTION COPY
  INREC IFOUTLEN=80,
        IFTHEN=(WHEN=GROUP,
                 BEGIN=(8,3,CH,NE,C' '),
                 PUSH=(81:8,3,1,7)),
        IFTHEN=(WHEN=(8,3,CH,EQ,C' ',
                     AND,
                      1,7,CH,EQ,84,7,CH),
                 OVERLAY=(8:81,3))


If you really want the sub-key value from the first record of the key:

Code:
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,
                 KEYBEGIN=(1,7),
                 PUSH=(8:8,3))
Back to top
View user's profile Send private message
f1org

New User


Joined: 14 Sep 2015
Posts: 6
Location: greece

PostPosted: Tue Sep 15, 2015 8:05 pm
Reply with quote

ok Nic

i am looking from other request of this forum...
Thanks for your reply
Back to top
View user's profile Send private message
f1org

New User


Joined: 14 Sep 2015
Posts: 6
Location: greece

PostPosted: Tue Sep 15, 2015 8:10 pm
Reply with quote

Bill you are the best
Thanks a lot
Back to top
View user's profile Send private message
f1org

New User


Joined: 14 Sep 2015
Posts: 6
Location: greece

PostPosted: Thu Sep 17, 2015 6:47 pm
Reply with quote

Bill can you suggest another method without WHEN=GROUP as we don't have the PTF's of DFSORT 1.5 ......
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Sep 17, 2015 7:14 pm
Reply with quote

Can you run this and paste the sysout from the step please, so that we can see exactly what you do have?

Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*


Any chance of an upgrade in the near future? You are way, way, way out of IBM support, even not knowing exactly what you have.
Back to top
View user's profile Send private message
f1org

New User


Joined: 14 Sep 2015
Posts: 6
Location: greece

PostPosted: Thu Sep 17, 2015 7:31 pm
Reply with quote

Hi Bill

we are out of support because of re migration process out of mainframe

ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 16:54 ON THU SE
OPTION COPY
ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E9-K90007 C9-BASE E5-K31980
ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICEAM1 INSTALLATION MODULE SELECTED
ICE088I 0 FRAGOS1 .S1 . , INPUT LRECL = 80, BLKSIZE = 80, TYPE = F
ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200798,6200798)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ER
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXIT
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAM
ICE235I 0 OPTIONS: NULLOUT=RC0
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Sep 17, 2015 8:14 pm
Reply with quote

Well, if you are a small site and not using the Mainframe at capacity, you should be OK.

You don't have WHEN=GROUP, you don't have JOINKEYS.

That leaves ICETOOL's SPLICE operator.

It would be simpler for you to write a small E35 Exit program in COBOL. There are some examples here (search this part of the forum for DIVISION or something like that).

There, do the same thing as the GROUP I suggested. When non-blank, store the three-character value and the key. When blank and key equal to saved key, copy the stored three characters to the record.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Sep 17, 2015 8:15 pm
Reply with quote

Has not DFSORT V1R5 been out of support since 2007? Is it taking so long to migrate to another platform (and if so, what does that say about the decision to migrate)?
Back to top
View user's profile Send private message
f1org

New User


Joined: 14 Sep 2015
Posts: 6
Location: greece

PostPosted: Fri Sep 18, 2015 2:53 pm
Reply with quote

Bill thanks for your advise
I make a cobol program for this

Best Regards
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top