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
 

 

Extracting data from a Report

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

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Thu Mar 03, 2011 5:34 pm    Post subject: Extracting data from a Report
Reply with quote

Hi
I have a report which is Fixed block and having the record length of 133. I want to pickup 15 characters wherever in the report 'AGENCY NAME :' appeared. The position is not fixed. Also, the next entire row where the 'ITEM NAME' is appearing. In the output, the data should come in a single line. The Example given below

Input

Code:
AGENCY NAME : ABC CORP. 
ITEM NAME
DB2 Z/OS Guide

AGENCY NAME : ABC CORP. 
ITEM NAME
COBOL refresher


The output I need as below.
Output

Code:
ABC CORP.    DB2 Z/OS Guide
ABC CORP.    COBOL refresher
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Mar 03, 2011 11:30 pm    Post subject:
Reply with quote

Your description of the requirement vs your example is rather confusing.

Are the lines you show the only lines in the report or are there other lines in the report that you need to ignore?

Quote:
the next entire row where the 'ITEM NAME' is appearing.


Huh? Are ITEM NAME and DB2 Z/OS Guide in two different records as shown, or in one record as implied by "the next entire row ...".

Quote:
I want to pickup 15 characters wherever in the report 'AGENCY NAME :' appeared. The position is not fixed.


It looks fixed in your example.

Please show a better example of your input records that clears up all this confusion about what it looks like.
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Fri Mar 04, 2011 7:39 am    Post subject:
Reply with quote

Sorry for the confusion.

Code:
ADDRESS : AGENCY NAME : ABC CORP.
          ITEM NAME 
          DB2 Z/OS Guide   

The order shipped on dated. 11/01/2010

ADDRESS : BENTICK STREET   AGENCY NAME : XYZ CORP. 
            NY             ITEM NAME
                           COBOL refresher
                          

Shipment received on dated 11/01/2010


The output I need as below.

Code:
ABC CORP.    DB2 Z/OS Guide
XYZ CORP.    COBOL refresher


Quote:
Are the lines you show the only lines in the report or are there other lines in the report that you need to ignore?


There are other lines in the report which I want to ignore.

Quote:
Are ITEM NAME and DB2 Z/OS Guide in two different records as shown, or in one record as implied by "the next entire row ...".


ITEM NAME and DB2 Z/OS Guide are two different records. What i need is, in my output I want to pick up 'DB2 Z/OS Guide'. And 'DB2 Z/OS Guide' will appear after 'ITEM NAME'
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Mar 05, 2011 12:24 am    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for.

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/133)
//SORTOUT DD DSN=...  output file (FB/133)
//SYSIN DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,120,SS,EQ,C'AGENCY NAME :'),
    RECORDS=3,PUSH=(134:SEQ=1)),
   IFTHEN=(WHEN=(134,1,ZD,EQ,1),
     PARSE=(%01=(STARTAFT=C'AGENCY NAME : ',FIXLEN=15)),
     BUILD=(%01,134:134,1)),
   IFTHEN=(WHEN=(134,1,ZD,EQ,3),
     PARSE=(%02=(STARTAT=NONBLANK,FIXLEN=20)),
     BUILD=(17:%02,134:134,1))
  OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(134,1,ZD,EQ,1),
    RECORDS=3,PUSH=(1:1,15))
  OUTFIL INCLUDE=(134,1,ZD,EQ,3),BUILD=(1,133)
/*
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts Easytrieve report shalem CA Products 4 Sun Feb 26, 2017 9:08 am


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