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
 

 

Creating a new report format based on an existing report

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

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Thu Apr 04, 2013 8:33 pm    Post subject: Creating a new report format based on an existing report
Reply with quote

Hi all,

Is it possible to pick values from a particular dataset and put it in desired positions on a new dataset. For eg,

Existing dataset contains -

Code:
ABC              DEF             GHI

JKL  :    123         XYZ : 789
MNO:    456


Output should be -

New report
==========================
Code:
DEF lost against ABC on GHI ground

JKL (Jersey num: 123) and MNO(Jersey
num: 456) scored for ABC.

XYZ(Jersey num: 789) scored for DEF.

==========================

Note: This is not the orginal requirement.. I just cooked it up.
But the requirement I have is something similar.

Any help will be highly appreciated.

Thanks,
Jay

Code'd
Back to top
View user's profile Send private message

mjgjaggu

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Thu Apr 04, 2013 8:38 pm    Post subject:
Reply with quote

One more point -

All the values in the new output file are either picked from the old file or hardcoded values.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Apr 04, 2013 8:47 pm    Post subject: Reply to: Creating a new report format based on an existing
Reply with quote

If there are rules which reliably map the input to output, yes, it can be done, in general, unless the rules require going beyond existing DFSORT functionality.
Back to top
View user's profile Send private message
mjgjaggu

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Fri Apr 05, 2013 2:00 pm    Post subject:
Reply with quote

Hi Bill,

Thanks for the quick reply.

Yes. There are specific rules.

1. The values to be picked from the old file are from specific position always and where it needs to be put in the new file is also fixed.
i.e. There is a mapping for each of the fields and the field positions.

2. The hardcoded values in the new file are also fixed, both for value and position.

Thanks,
Jay
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Fri Apr 05, 2013 3:18 pm    Post subject: Reply to: Creating a new report format based on an existing
Reply with quote

OK, but I was expecting at least a bit of a hint as to what the rules might be.

So, for the "first line" is it always "winner, loser, ground"? Can there be a tie?

How do you identify the "first line"? Absence of ":"?

Then you seem to have a number of lines which indicate who scored first for winner, then loser, then next line is winner/loser, etc until no more scores?

What is the maximum number of scores?

How to identify the "scores" lines?

What if there is no score?

RECFM and LRECL of input and output.

Some more representative sample data, covering the above, in the Code tags please.
Back to top
View user's profile Send private message
mjgjaggu

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Fri Apr 05, 2013 4:24 pm    Post subject:
Reply with quote

Hi Bill,

As I had mentioned in the initial post, that was only an example report. We do not have to check for conditions or derive values.

The basic requirement is to pick values from input file, from specific positions and place it in specific positions on the output file.
Along with this, I need to incorporate some static hardcoded text in the output file.

The record format is FB and LRECL is 133 for both input and output.

I am sorry if I made it more complicated :-).

Thanks,
Jay
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Apr 05, 2013 4:42 pm    Post subject: Reply to: Creating a new report format based on an existing
Reply with quote

Quote:
I am sorry if I made it more complicated


nope, You are just not describing things properly ?

from You description it seems that the values You describe occur only once in the file

but the <report> name seems to imply differently
data repeated according to some <grouping>


post a longer example of the input data
alonf with the relative output expected
Back to top
View user's profile Send private message
mjgjaggu

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Fri Apr 05, 2013 5:19 pm    Post subject: Reply to: Creating a new report format based on an existing
Reply with quote

Please find the exact requirement in the attachment.

All the labels in Black color are to be picked from the original file and put in their respective positions in the output file.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon Apr 08, 2013 3:04 pm    Post subject: Reply to: Creating a new report format based on an existing
Reply with quote

So, use a number of IFTHEN=(WHEN=GROUP with BEGIN to identify the lines containing the data you want, and PUSH to locate a copy of that data (all that you need) into different positions.

This will mean that all records after your last WHEN-GROUP contain all the data you need, and all the previous records are useless. So arrange for an OUTFIL INCLUDE to pick up a record which now has all the data.

Use OUTFIL BUILD with the "slash operator" (/) which allows multiple output records from a single input record. Use several of these to format your new report, with a mixture of the data you have PUSHed and the new constants that you need.
Back to top
View user's profile Send private message
mjgjaggu

New User


Joined: 22 Jun 2009
Posts: 8
Location: Germany

PostPosted: Mon Apr 08, 2013 4:17 pm    Post subject:
Reply with quote

Ok. Thanks. I will try this out..
In the meantime, If you could provide me with an example, it would really help my cause.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon Apr 08, 2013 4:33 pm    Post subject: Reply to: Creating a new report format based on an existing
Reply with quote

There are examples in the manuals of WHEN=GROUP. Just use multiple ones, putting different data into different places.

There are also examples of OUTFIL INCLUDE in the same place, and of OUTFIL BUILD with the '/' operator.


Code:

  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'1'),PUSH=(81:2,5)),
        IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'2'),PUSH=(86:2,5))
  OUTFIL INCLUDE=(1,1,CH,EQ,C'2'),
         BUILD=(C'NEW REP',3X,86,5,/,C'2ND LINE',2X,81,5)

//SYSIN DD *
1FIRST
2LASTT


Untested, but this should take the input "report", extract some "data" to, here, the last record (not because it is the last, but because it has '2' in the first position of the record), include only the last record, then produce a new "report" with contstants and the extracted data.

EDIT: Now "tested and tarted".
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 Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Detailed Transaction History report f... Kyle Carroll CICS 5 Tue Oct 18, 2016 12:42 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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