|
View previous topic :: View next topic
|
| Author |
Message |
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
Using JCL Sort i need to get values from same byte position from 2 different Input files and write to a single output file, for the comparing purpose
eg From input FILE 1 extract data from postion 118 to 130 and 186 to 232
From Input FILE 2 extract data from postion 118 to 130 and 186 to 232
Output FILE 3 will have extracted data from FILE 1 and FILE 3 like below
file 1 contents file 2 contents
File 3 -> 118 to 130 186 to 232 118 to 130 186 to 232
Any helps is appreciable
Thanks |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
| Sample input and output plus RECFM and LRECL would be useful but you may be able to do this with JOINKEYS. |
|
| Back to top |
|
 |
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
I used below Sort for the above objective, but Step S4 is failing with
AB = S013
Any help is appreciable
| Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=I90496.INV250.CSP.C111PREM,DISP=SHR
//SORTOUT DD DSN=&&TEMP,DISP=(NEW,PASS),
// SPACE=(TRK,(50,50),RLSE),DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1:118,12,14:192,38)
/*
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=I90496.INV250.CSP.C111PREM.JAVA,DISP=SHR
//SORTOUT DD DSN=&&TEMP1,DISP=(NEW,PASS),
// SPACE=(TRK,(50,50),RLSE),DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1:118,12,14:192,38)
/*
//S3 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&TEMP,DISP=OLD
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'FILE1VAL,''',1,60,C'''')
/*
//S4 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SYMNOUT DD SYSOUT=*
//SORTIN DD DSN=&&TEMP1,DISP=OLD
//SORTOUT DD SYSOUT=*,DCB=(RECFM=FB,LRECL=200)
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(C'OUT',FILE1VAL,1,60)
/* |
Code'd |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You have not posted the diagnosticds you were presented by the run . . .
Is the s013 an s013-20?
Why have you not posted the requested data? |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
Sumeendar,
As told, are the input files sorted? is/are there any common key(s) between two files? if answer to this is yes then the quickest way is to use JOINKEYS.
How is(&&S1)
| Quote: |
| Code: |
| //SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS) |
|
being used here?
And as Dick suggested, please provide the SYOUT/Spool messages related to the failure for the exact rectifications and it is best practice to use a CODE tag. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
However if there is no common key then you can use the trick "Join fields from two files record-by-record" from the below link (ofcource please do necessary modifications as per your offset instead of a whole record),
ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You really have to clarify what it is you are trying to do.
Show a sample of data from both input files, and the expected output for that data, and a description of how that should happen.
Your S013 is probably because you haven't defined your SYMNAMES DSN as F/FB LRECL 80, which you could do by specifying an extra ..,80:X) where you are defining your record.
Please use BUILD instead of INREC/OUTREC FIELDS or OUTFIL OUTREC, which only exist for backwards-compatibility.
I don't think your generated symbol is doing what you want, even though I don't know what you want. |
|
| Back to top |
|
 |
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
i have given SYMNAMES DSN as F/FB LRECL 80, by specifying an extra ..,80:X),
upon doing this my error as changs to ABENDU16 in Step S4 with below information
| Code: |
. . . . . . . . . . . . . . . . . . . . . . . . . . .
Display Filter View Print Options Search Help
-------------------------------------------------------------------------------
ISOE OUTPUT DISPLAY I9011324 JOB00082 DSID 108 LINE 0 COLUMNS 02- 81
COMMAND INPUT ===> SCROLL ===> CSR
********************************* TOP OF DATA **********************************
SYNCSORT FOR Z/OS 1.4.1.0N U.S. PATENTS: 4210961, 5117495 (C) 2010 SYNCSO
WER513A ERRORS IN SYMNAMES STATEMENTS
FILE1VAL,'VC111.243.1B C102 '
*
WER516A DUPLICATE SYMBOL DEFINITION
FILE1VAL,'VC111.244.1B C102 '
*
WER516A DUPLICATE SYMBOL DEFINITION
FILE1VAL,'VC111.245.1B C102 '
*
WER516A DUPLICATE SYMBOL DEFINITION
FILE1VAL,'IC111.246.1B C102C111 '
*
WER516A DUPLICATE SYMBOL DEFINITION
FILE1VAL,'VC111.122.1B C102C133 '
*
WER516A DUPLICATE SYMBOL DEFINITION
FILE1VAL,'VC111.123.1B C102C133J129 '
*
WER516A DUPLICATE SYMBOL DEFINITION
FILE1VAL,'VC111.124.1B C102C133 '
*
WER516A DUPLICATE SYMBOL DEFINITION
FILE1VAL,'VC111.125.1B C102C133J129 '
*
WER516A DUPLICATE SYMBOL DEFINITION
FILE1VAL,'IC111.126.1B C102C111C133J143 '
*
WER516A DUPLICATE SYMBOL DEFINITION
FILE1VAL,'VC111.127.1B C102C133 '
*
WER516A DUPLICATE SYMBOL DEFINITION
FILE1VAL,'VC111.128.1B C102C133J129 '
*
WER516A DUPLICATE SYMBOL DEFINITION |
Code'd |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Your have SyncSort (WER messages) not DFSORT, so your topic has been moved to the JCL forum where SyncSort questions live.
You have to take note of all that is said, and not just a bit which is superficially useful to you. I suggested your code would not work.
You are generating a symbol. Symbols have to be unique. Unless your file has only one record, this idea is not going to work.
If you describe, fully, answering anything remaining which was asked of you, there will probably be a reasonably short solution. But until we know what you want, including the compare part, there is not much point in suggesting anything. |
|
| Back to top |
|
 |
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
okay i will be more precise on what i need
I have one file (namely FILE1) with multiple records having values 'VC111.242.1B' residing in position 118 to 130 and values 'C102C118' residing in position 192 to 200'
Similarly I have another file (namely FILE2) with multiple records having values 'VC111.242.1B' residing in position 118 to 130 and values 'C102C240' residing in position 192 to 200'
Using JCL SORT, i need to generate a 3rd file (FILE3), which contains above FILE1 and FILE2 values residing in below manner
VC111.242.1B C102C118 VC111.242.1B C102C240
I tried using SYSNAMES, but that do not support with multiple records. Is there a any better solution using SORT utility to attain the above objective
Thanks in advance |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| Would you be kind enough to look at what I said and asked? |
|
| Back to top |
|
 |
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
Sumeendar,
Please re-read all the posts and reply to the questions asked. Post some sample input records, some 4-5 records from both the files (showing relevant fields) and the expected output out of it and the rules by which you arrived at that output. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|