Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Change second record based on value in the first record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Thu Aug 06, 2015 12:04 am    Post subject: Change second record based on value in the first record
Reply with quote

Is it possible?

I have file ( 80 char) with paired records by first 5 positions

INPUT:

Code:

AP060 11111  11111 11111111                       
AP060 2 2    2 22   22 2                           
AP000 11111  11111 11111111 11111111111           
AP000 2 2    2 22   22 2      22 2                 


can sort change blanks to asterisks in second record if that position in first record is not blank

OUTPUT:
Code:

AP060 11111  11111 11111111                           
AP060 2*2**  2*22* *22*2***                           
AP000 11111  11111 11111111 11111111111               
AP000 2*2**  2*22* *22*2*** **22*2*****               


Thanks
Back to top
View user's profile Send private message

RahulG31

Active User


Joined: 20 Dec 2014
Posts: 444
Location: USA

PostPosted: Thu Aug 06, 2015 12:49 am    Post subject: Reply to: Change second record based on value in the first record
Reply with quote

Do the blanks/asterisks in the second record have fixed positions ?
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Thu Aug 06, 2015 12:56 am    Post subject: Reply to: Change second record based on value in the first record
Reply with quote

No, the blanks position in second records not in fix position, could be in any position
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Thu Aug 06, 2015 2:22 am    Post subject: Reply to: Change second record based on value in the first record
Reply with quote

Use WHEN=GROUP with KEYBEGIN to PUSH the data from the first record to a temporary extension, along with a SEQ=1.

If the PUSHed SEQ=2, and PUSHed data (one position at a time) not equal to space and data on record 2 (one position at a time) equal to space, set that position to *.

You'll need 75 IFTHEN=(WHEN=(logicalexpression) with HIT=NEXT.

Is that data only 1s or 2s, or is that just your example?
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 444
Location: USA

PostPosted: Thu Aug 06, 2015 2:25 am    Post subject: Reply to: Change second record based on value in the first record
Reply with quote

A simple thing I could think of is:
Use When=Group, Records=2 and Push the entire first record (80 bytes) to 81 - 160. Then check if position 81 has a value but position 1 have a space; Overlay the space at position 1 with '*'. In the end Build only 1:80.

You'll have to check for all the possible 80 positions. So, the sort card gets repetitive and lengthy.

I am not sure if there is an easier way since the positions of blanks/asterisks on the second record are not fixed.
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Thu Aug 06, 2015 2:27 am    Post subject: Reply to: Change second record based on value in the first record
Reply with quote

thank you, I will try .... the file is just sample
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Thu Aug 06, 2015 5:56 am    Post subject: Reply to: Change second record based on value in the first record
Reply with quote

great.. it worked ... sort is a king of a software
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 Process only last key record in a fil... Naveen.katkuri24 DFSORT/ICETOOL 8 Tue Oct 09, 2018 9:39 am
No new posts SYNCSORT keep MIN/MAX record Cloink SYNCSORT 16 Mon Sep 17, 2018 3:00 pm
No new posts Sort card to find duplicates, without... anand1204 DFSORT/ICETOOL 15 Fri Aug 31, 2018 12:13 am
No new posts How to add new LPARs and change exist... Alan Playford All Other Mainframe Topics 0 Thu Aug 23, 2018 5:52 pm
No new posts Splitting one record in a file to 10 ... mf_123 DFSORT/ICETOOL 9 Tue Aug 21, 2018 8:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us