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

combine 2 records into 1 conditionally


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Mon May 26, 2014 2:42 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top