View previous topic :: View next topic
|
Author |
Message |
VivekKhanna
New User
Joined: 09 Feb 2009 Posts: 57 Location: India
|
|
|
|
Hi,
I am facing some problem in comparing two datasets (PS) and getting the results in third (new) dataset.
Key information will start from Column 3 and will be 9 chars long.
Dataset 1: (FB, LRECL=402)
Code: |
----+---10----+---20----+---30----+---40----+---50----+---60----+---70----
D 111111111232365542255...................................................................
D 111111112325647451325...................................................................
D 111111113568145452323...................................................................
D 111111114654673324SFV..................................................................
|
Dataset 2: (FB, LRECL=402)
Code: |
----+---10----+---20----+---30----+---40----+---50----+---60----+---70----
D 111111111232365542255...................................................................
D 111111113568145452323...................................................................
D 1111111173524GHJ32443..................................................................
|
The problem is that I need to compare both the datasets and the result should be stored in the third (new) dataset. The output dataset should contain all the records from Dataset 1 & Dataset 2 and matching records should be marked with indicator 'P' at in the second column. The output should be:
Code: |
----+---10----+---20----+---30----+---40----+---50----+---60----+---70----
DP111111111232365542255..................................................................
D 111111112325647451325...................................................................
DP111111113568145452323..................................................................
D 111111114654673324SFV..................................................................
D 1111111173524GHJ32443..................................................................
|
|
|
Back to top |
|
|
VivekKhanna
New User
Joined: 09 Feb 2009 Posts: 57 Location: India
|
|
|
|
A small mistake, I need all the records for Dataset 1, but no records from Dataset 2 in the output dataset. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Since you changed the "rules" from your first post where you showed the expected output to your second post where you didn't, it's difficult to know what you really want.
Please start over and show a better example of the records in each input file 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. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
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 |
|
|
|