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

Combine two records into one record from two files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Christy

New User


Joined: 17 Nov 2010
Posts: 14
Location: India

PostPosted: Fri Jan 07, 2011 12:37 pm
Reply with quote

Hi,

I have an input file A as follows:

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7
 1,00.00                                                        CR




Into the same file i want to include:

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7
  AMOUNT                               1234513                  CR



To get the final output i can only use the below type code:
Code:

SORT FIELDS=(1,1,CH,A)
OUTFIL FILES=1,
NODETAIL,
TRAILER1=(3:'AMOUNT',
                 40:COUNT))


How can i get the desired output using OUTFIL?
What ever be the data in Input file A i need only the last field to be attached(that ia CR or what evar it may be) with the second record using outfil to generate the second file.
I can only use dfsort also.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Jan 11, 2011 2:07 am
Reply with quote

I have no idea what it is you're asking for. Your description is totally confusing.

Please try again to describe what you want to do more clearly.

Show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files.

Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN    DD    *
    OPTION COPY
/*
Back to top
View user's profile Send private message
Christy

New User


Joined: 17 Nov 2010
Posts: 14
Location: India

PostPosted: Wed Jan 12, 2011 1:20 pm
Reply with quote

I have a input file where there is one field which is the amount field.

Code:

INPUT FILE 1

AMOUNT     

 100.00
 2000.00
 90.00
 56.00
 1.00
-22.00
-2.00





This is the amount field which will be summed to get the total.
The amount field has the format/type S9(13).99
If the sum of the amount field is positive that is greater than zero i will create an output file with the total sum of the amount field at position 2 of the output file and place "CR" at the position 65. if the value is less than zero i will create the output file with the total amount at position 2 and "DR" at position 65.

This output file is the input file A which i have shown above.

In another file i have the data given above where the word "AMOUNT" is at position 3 and the count of the total number of records at position 40, the total sum of the amount field at position 50 (which i didn't include in the above file).


Now i need a file using a sort card where i can club both the files, so the word "CR" or "DR" will be added to the second file at position 65 with the rest of the record remaining the same. That is it will contain the word "AMOUNT" in position 3.Total count in position 40, sum of amount in position 50 and the word CR/DR according to the sum of amount field at position 65.

I can only use a sort card which contains TRAILER1 and OUTFIL.

Hope i am clear now.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jan 12, 2011 8:06 pm
Reply with quote

Hello,

Why did you not post the output from the job Frank asked you to run. . . icon_sad.gif

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

DFSORT Developer


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

PostPosted: Wed Jan 12, 2011 11:36 pm
Reply with quote

Christy,

You didn't provide the information I asked for. I can't help you unless you do.

Quote:
I can only use a sort card which contains TRAILER1 and OUTFIL.


Huh? Why? Is this a homework assignment?

If you are trying to solve a business problem with DFSORT, I'm happy to help you if you give me the information I need to understand your requirement. But I don't see any reason to restrict how the solution can be obtained. Why wouldn't you want the best, most efficient solution, rather than one arbitrarily restricted in some way.
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 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top