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
 

 

Report to An output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Wed Apr 27, 2011 8:13 pm    Post subject: Report to An output file
Reply with quote

Hi,

I have an Easytrieve code wherein the report is going to the SYSPRINT.
LIST ON
*
**** INPUT FILE
*
FILE IN1
IN1-REC 1 76 A
IN1-OLD-BBB 1 29 A
IN1-OLD-MMM 30 09 N
IN1-NEW-BBB 39 29 A
IN1-NEW-MMM 68 09 N
*
**** SELECT QUERY
*
FILE IN2
IN2-REC 1 133 A
IN2-OLD-MMM 1 09 N
IN2-CCC-NO 10 09 N

*
**** OUTPUT FILE
*
FILE OUT1
OUT1-REC 1 28 A
* OUT1-OLD-MMM 1 09 N
* OUT1-NEW-MMM 10 09 N
* OUT1-CCC-NO 19 10 N

WS-OLD-MMM W 09 N VALUE 0
WS-NEW-MMM W 09 N VALUE 0

JOB INPUT NULL
* DISPLAY 'INSIDE'
IF EOF IN1
STOP
ELSE
GET IN1
END-IF
IF EOF IN2
STOP
ELSE
GET IN2
END-IF
IF IN1-OLD-MMM = IN2-OLD-MMM
* DISPLAY 'IN1-OLD-MMM' IN1-OLD-MMM
* DISPLAY 'IN2-OLD-MMM' IN2-OLD-MMM
PRINT OUT1
GET IN1
GET IN2
* GO TO JOB
ELSE
IF IN1-OLD-MMM > IN2-OLD-MMM
* DISPLAY 'IN1-OLD-MMM' IN1-OLD-MMM
* DISPLAY 'IN2-OLD-MMM' IN2-OLD-MMM
GET IN2
IF EOF IN2
STOP
ELSE
GET IN1
END-IF
* GO TO JOB
ELSE
* DISPLAY 'IN2-OLD-MMM' IN1-OLD-MMM
* DISPLAY 'IN2-OLD-MMM' IN1-NEW-MMM
GET IN1
IF EOF IN1
STOP
END-IF
* GO TO JOB
END-IF
END-IF
REPORT OUT1 LINESIZE 80 SUMMARY SPREAD
SEQUENCE IN2-OLD-MMM
CONTROL IN2-OLD-MMM
LINE IN2-OLD-MMM WS-NEW-MMM

*START-PROC. PROC
* GET IN1
* GET IN2
*END-PROC


I want the report to go to OUTPUT file.

Kindly advise.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Apr 27, 2011 8:24 pm    Post subject:
Reply with quote

Look up SUMFILE in the manual.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2435
Location: Netherlands, Amstelveen

PostPosted: Wed Apr 27, 2011 10:01 pm    Post subject:
Reply with quote

Or use PRINTER for your FILE OUT1, and to expand on Bill Woodger's comment read the fine manual.
Back to top
View user's profile Send private message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Thu Apr 28, 2011 4:46 pm    Post subject:
Reply with quote

I used as below,

FILE OUT1 PRINTER

Report is going to SYSPRINT.

Also for using SUMFILE, I had to remove PRINTER from FILE description.

WHEN I used SUMFILE,

the values of IN2-OLD-MMM and WS-NEW-MMM come in the output file.

They are not in the report format.

Please let me know how to get the report in SYSPRINT to output file.

The SYSPRINT report is as below,

1 4/28/11 REPORT1 PAGE 1
-
IN2-OLD-MMM WS-NEW-MMM
0 111111111


Thanks in advance.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2435
Location: Netherlands, Amstelveen

PostPosted: Thu Apr 28, 2011 5:53 pm    Post subject:
Reply with quote

//OUT1 DD your printfile dataset

FILE OUT1 PRINTER FB(133 6118)

REPORT OUT1 PRINTER OUT1 LINESIZE 132 SUMMARY SPREAD
SEQUENCE IN2-OLD-MMM
CONTROL IN2-OLD-MMM
LINE IN2-OLD-MMM WS-NEW-MMM
Back to top
View user's profile Send private message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Thu Apr 28, 2011 7:14 pm    Post subject:
Reply with quote

Thanks a Ton!!!!
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Apr 28, 2011 9:31 pm    Post subject: Re: Report to An output file
Reply with quote

Elixir,

I think you have problems with your code. I have "tarted it up" to make it easier to follow.

In the first part of the flow, you read (GET) records from both files.

If you then find a match, you do your stuff, read records from both files, then go to the first part of the flow again. Where you immediately read records from both files. Similar with the other reads in the conditional logic. You are skipping records.

Easytrieve Plus has built-in file matching logic. You might want to look this up and apply it.


Also, presumably your files are sequenced on IN1-OLD-MMM/IN2-OLD-MMM? Therefore, there is no reason to SEQUENCE the report. If already in that order, then why sort it again?

The default column headings for IN2-OLD-MMM and WS-NEW-MMM (or any data-name on a report line) is the data-name itself. That is why you had them on the output. Column headings. If you don't want them, look at the REPORT statement and its options in the manual.

You don't ever put anything in WS-NEW-MMM.

Elixir wrote:

JOB INPUT NULL
IF EOF IN1
STOP
ELSE
GET IN1
END-IF
IF EOF IN2
STOP
ELSE
GET IN2
END-IF
IF IN1-OLD-MMM = IN2-OLD-MMM
PRINT OUT1
GET IN1
GET IN2
ELSE
IF IN1-OLD-MMM > IN2-OLD-MMM
GET IN2
IF EOF IN2
STOP
ELSE
GET IN1
END-IF
ELSE
GET IN1
IF EOF IN1
STOP
END-IF
END-IF
END-IF


REPORT OUT1 LINESIZE 80 SUMMARY SPREAD
SEQUENCE IN2-OLD-MMM
CONTROL IN2-OLD-MMM
LINE IN2-OLD-MMM WS-NEW-MMM

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 -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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