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
 

 

Combine two records into one record from two files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Combine two records into one record from two files
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 Moderator


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

PostPosted: Tue Jan 11, 2011 2:07 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Jan 12, 2011 8:06 pm    Post subject: Reply to: Combine two records into one record from two files
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 Moderator


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

PostPosted: Wed Jan 12, 2011 11:36 pm    Post subject:
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    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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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