Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Replace fields with spesific values from other records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Replace fields with spesific values from other records
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: 1715
Location: UK

PostPosted: Tue Sep 15, 2015 3:49 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue Sep 15, 2015 4:36 pm    Post subject: Reply to: Replace fields with spesific values from other records
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue Sep 15, 2015 4:57 pm    Post subject: Reply to: Replace fields with spesific values from other records
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    Post subject:
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu Sep 17, 2015 7:14 pm    Post subject: Reply to: Replace fields with spesific values from other records
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu Sep 17, 2015 8:14 pm    Post subject: Reply to: Replace fields with spesific values from other records
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: 1738
Location: Bloomington, IL

PostPosted: Thu Sep 17, 2015 8:15 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us