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
 

 

combine 2 records into 1 conditionally

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

New User


Joined: 08 Jan 2013
Posts: 20
Location: usa

PostPosted: Sat May 24, 2014 1:28 am    Post subject: combine 2 records into 1 conditionally
Reply with quote

I have a report file I am going to change into a CSV file

The report has 2 types of detail lines
Code:
00999999   TESTT  TEST , TEST  39-110    3-WARNING        COMP TIME
                                                RPTD HRS BLNC =         2.3
00999999   TEST, TEST R.      39-475    3-WARNING        EIGHT OR LESS
00999924   TEST  TEST, TEST 39-110    3-WARNING        COMP TIME
                                                RPTD HRS BLNC =     
.2

The first 9 bytes are either a numeric value or it is spaces and has the literal RPTD HDRS BLNC in col 55.

I would like to append the data from the RPTD line into the line above it in a cosolidated output record. Not all numeric details lines have the second line.

Using the data from above I would want output to look like

Code:
00999999,TESTT  TEST,TEST,39-110,3-WARNING,COMP TIME,RPTD HRS BLNC =         2.3
00999999,TEST,TEST R.,39-475,3-WARNING,EIGHT OR LESS
00999924,TEST  TEST,TEST,39-110, 3-WARNING,COMP TIME, RPTD HRS BLNC = 


I just am looking for the technique to combine these 2 records when there are 2, and just put out the 1 record when it doesn't have that extra line, I know how to string the fields together using build etc.. All fields on the report are in a fixed column, i.e the id number is 1,9 and the literal RPTD starts in 55 and has blanks in 1-9

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

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1534
Location: Andromeda Galaxy

PostPosted: Mon May 26, 2014 2:42 pm    Post subject:
Reply with quote

1.Use WHEN=GROUP BEGIN when you have 'COMP TIME' and the condition which can identify your first record and end at 'RPTD HDRS BLNC' and do a PUSH of data and SEQ
2.Take records with sequence number 2 and which has SPACES in position of sequence number
3.Reformat to your need
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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