Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all 8500 articles
Browse latest View live

SYNCSORT :: RE: JOINKEYs and Variable files

$
0
0
Author: Bill Woodger
Subject: Reply to: JOINKEYs and Variable files
Posted: Sat Jun 18, 2016 12:34 am (GMT 5.5)

The REFORMAT statement, like any record, only has "one" RDW, which is at position 1, for a length of 4. 5,4, although it was sourced from an RDW, is not an RDW, it is just data, so doesn't count.

You have to use the only RDW possible. SyncSORT will work out the rest.


SYNCSORT :: RE: JOINKEYs and Variable files

$
0
0
Author: Bill Woodger
Subject: Reply to: JOINKEYs and Variable files
Posted: Sat Jun 18, 2016 12:43 am (GMT 5.5)

On top of that, REFORMAT records with two variable parts are... exciting.

You have two, more useful, possibilities: use a fixed-length REFORMAT record, and FTOV/CONVERT with VLTRIM on the OUTFILs; use one fixed-length source and one variable-length, and only one FTOV/CONVERT in OUTFIL.

It's also not clear what limitation you came across in the JOINKEYS which means you've stuck to 64 bytes.

Presuming that your data is in key order, use SORTED on each of the JOINKEYS statements. If not in key order, then you may be representing an artificial picture.

DFSORT/ICETOOL :: RE: Next max

$
0
0
Author: kgumraj2
Posted: Sat Jun 18, 2016 2:01 pm (GMT 5.5)

Thanks everyone.
It has only one space record, that needs to be updated.

Special thanks to sqlcode1.
_________________
Have a Great Day !!!
Kiran G R

SYNCSORT :: RE: JOINKEYs and Variable files

$
0
0
Author: migusd
Posted: Sun Jun 19, 2016 7:18 am (GMT 5.5)

this is the execution with the first part of your suggestions, Rohit & Bill

the msg I got is this
UBADS383,JS0030 , -SORTOF1 OUTREC RDW NOT INCLUDED

and the sort parms

Quote:
JOIN UNPAIRED,F1,F2
JOINKEYS FILE=F1,FIELDS=(19,64,A)
JOINKEYS FILE=F2,FIELDS=(19,64,A)
REFORMAT FIELDS=(F1:1,004, RDW
F1:05,013, 005 - 017 PREVIOUS TES
F2:05,013, 018 - 030 CURRENT TES
F1:19, 031 - 094 PREVIOUS ESRIDNM
F2:19), 095 - 158 CURRENT ESRIDNM
FILL=X'FF'
OMIT COND=(5,13,CH,EQ,18,13,CH,AND,031,064,CH,EQ,095,064,CH)
SORT FIELDS=COPY
OUTFIL FILES=1, * DELETED ESRIDNMS
INCLUDE=(5,1,BI,EQ,X'FF'),
BUILD=(DTES,PIP,PESR),
HEADER2=(10:' DELETED ESRIDNMS',/,
01:'TES #',
15:'ESRIDNM DESCRIPTION')
OUTFIL FILES=2, * ADDED ESRIDNMS
INCLUDE=(018,1,BI,EQ,X'FF'),
BUILD=(ATES,PIP,FESR),
HEADER2=(10:' ADDED ESRIDNMS',/,
01:'TES #',
15:'ESRIDNM DESCRIPTION')
* OUTFIL FILES=3, * CHANGED ESRIDNMS
* INCLUDE=(018,1,BI,EQ,X'FF'),
* BUILD=(RDW0,DTES,PIP,PESR,PIP,ATES,PIP,FESR),
* HEADER2=(10:' CHANGED ESRIDNMS',/,
* 01:'TES #',
* 15:'ESRIDNM DESCRIPTION')
DATA DICTIONARY SYMBOLS SUBSTITUTED :
JOIN UNPAIRED,F1,F2
JOINKEYS FILE=F1,FIELDS=(19,64,A)
JOINKEYS FILE=F2,FIELDS=(19,64,A)
REFORMAT FIELDS=(F1:1,004,F1:05,013,F2:05,013,F1:19,F2:19),FILL=X'FF'
OMIT COND=(5,13,CH,EQ,18,13,CH,AND,031,064,CH,EQ,095,064,CH)
SORT FIELDS=COPY
OUTFIL FILES=1,INCLUDE=(5,1,BI,EQ,X'FF'),BUILD=(5,13,C'|',31,64),HEADER2=(10:' D
ELETED ESRIDNMS',/,01:'TES #',15:'ESRIDNM DESCRIPTION')
OUTFIL FILES=2,INCLUDE=(018,1,BI,EQ,X'FF'),BUILD=(18,13,C'|',95,64),HEADER2=(10:
' ADDED ESRIDNMS',/,01:'TES #',15:'ESRIDNM DESCRIPTION')
WER813I INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER276B SYSDIAG= 4290742, 11632663, 11632663, 9737185
WER164B 46,016K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,000K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER481I JOINKEYS REFORMAT RECORD LENGTH= 544, TYPE = V
WER235A SORTOF1 OUTREC RDW NOT INCLUDED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

_________________
shikoulitz

SYNCSORT :: RE: JOINKEYs and Variable files

$
0
0
Author: migusd
Posted: Sun Jun 19, 2016 7:43 am (GMT 5.5)

Hi Rohit & Bill,
I made a second attempt and still got the same
Quote:

JOIN UNPAIRED,F1,F2
JOINKEYS FILE=F1,FIELDS=(19,64,A),SORTED,TYPE=V
JOINKEYS FILE=F2,FIELDS=(19,64,A),SORTED,TYPE=V


I misunderstood the manual... there is no max length for the field in JOINKEY... what it says (p 2.58) the max number of fields for a JOINKEY is 64... my mistake...

I will try your second suggestion, Bill
_________________
shikoulitz

SYNCSORT :: RE: JOINKEYs and Variable files

$
0
0
Author: migusd
Posted: Sun Jun 19, 2016 9:31 am (GMT 5.5)

Hi Bill,
I tried your suggestion and didn't worked
Apparently SYNCSORT didn't like the idea of using a fixed Reformat and variable length files.

here is an extract
Quote:
JOIN UNPAIRED,F1,F2,ONLY
JOINKEYS FILE=F1,FIELDS=(19,255,A),SORTED,TYPE=V
JOINKEYS FILE=F2,FIELDS=(19,255,A),SORTED,TYPE=V
REFORMAT FIELDS=(F1:05,013, 001 - 013 PREVIOUS TES
F2:05,013, 014 - 026 CURRENT TES
F1:19,255, 027 - 281 PREVIOUS ESRIDNM
F2:19,255), 282 - 536 CURRENT ESRIDNM
FILL=X'FF'
OUTFIL FILES=1, * DELETED ESRIDNMS
INCLUDE=(5,1,BI,EQ,X'FF'),
BUILD=(DTES,PIP,DESR),
FTOV,VLTRIM=X'40',
HEADER2=(10:' DELETED ESRIDNMS',/,
01:'TES #',
15:'ESRIDNM DESCRIPTION'),
TRAILER1=(20/,
10:'NUMBER OF DELETED ESR IDS:',
COUNT)

....
WER107A SORTOF1 RECFM INCOMPATIBLE WITH REPORT WRITING
WER110I SORTOF1 : RECFM=VB ; LRECL= 275; BLKSIZE= 27998
WER110I SORTOF2 : RECFM=VB ; LRECL= 275; BLKSIZE= 27998
WER107A SORTOF2 RECFM INCOMPATIBLE WITH REPORT WRITING

_________________
shikoulitz

SYNCSORT :: RE: JOINKEYs and Variable files

$
0
0
Author: Bill Woodger
Subject: Reply to: JOINKEYs and Variable files
Posted: Sun Jun 19, 2016 1:31 pm (GMT 5.5)

It's an oblique way of telling you that if you use OUTFIL reporting features you need an A in your RECFM for the output, because a printer-control character is inserted before the first position of each record.

Now, you don't actually want that. You'd like those Control Characters to not be there. So on the OUTFIL, you specify REMOVECC, and they won't be there.

Please use the Code tags, not the Quote tags, for marking-up anything which needs to retain proportional spacing.

SYNCSORT :: RE: JOINKEYs and Variable files

$
0
0
Author: migusd
Posted: Sun Jun 19, 2016 11:34 pm (GMT 5.5)

yes!!!
That made the difference, Bill... ...
Thank you so much!!!
I owe you one more....
Thanks also to Rohit
icon_smile.gif
_________________
shikoulitz


DFSORT/ICETOOL :: RE: Adding a descending character to a file

$
0
0
Author: Steve Ironmonger
Posted: Fri Jul 15, 2016 8:19 pm (GMT 5.5)

Thanks guys, there are approx 5 million records so the suggestion from Garry is perfect :-

Code:
SORT FIELDS=COPY                       
INREC FIELDS=(1,9,C',NI',SEQNUM,7,ZD) 
OUTREC  IFTHEN=(WHEN=(13,1,CH,EQ,C'0'),
        BUILD=(1,12,14,6,C'A')),       
IFTHEN=(WHEN=(13,1,CH,EQ,C'1'),       
        BUILD=(1,12,14,6,C'B')),       
IFTHEN=(WHEN=(13,1,CH,EQ,C'2'),       
        BUILD=(1,12,14,6,C'C')),       
IFTHEN=(WHEN=(13,1,CH,EQ,C'3'),       
        BUILD=(1,12,14,6,C'D')),       
IFTHEN=(WHEN=(13,1,CH,EQ,C'4'),       
        BUILD=(1,12,14,6,C'E')),       
IFTHEN=(WHEN=(13,1,CH,EQ,C'5'),       
        BUILD=(1,12,14,6,C'F')),       
IFTHEN=(WHEN=(13,1,CH,EQ,C'6'),       
        BUILD=(1,12,14,6,C'G'))       


the above works a treat !

thanks for all your help

DB2 :: DB2 FLOAT precision

$
0
0
Author: soundarr
Subject: DB2 FLOAT precision
Posted: Fri Jul 15, 2016 9:47 pm (GMT 5.5)

Hi All,

I am populating a FLOAT column with -99.9634495 via PL1 program and check in the table, it is stored as -9.9963449499999999E+01. I try the same via SPUFI/file manager, same result.

When I select the value from SPUFI, I see -99.9634495 whereas File manager shows -9.9963449499999999E+01.

Please suggest if there is any way to store it without the padded 9s in the table?

Thanks
Soundar

DB2 :: RE: DB2 FLOAT precision

$
0
0
Author: soundarr
Posted: Fri Jul 15, 2016 10:51 pm (GMT 5.5)

-99.9634495 is just an example. Issue(padded 9s) happens on some values. I couldn't find any pattern. Want to know if this is a limitation with DB2 FLOAT and if it can be handled in any way.

DB2 :: RE: DB2 FLOAT precision

$
0
0
Author: Rohit Umarjikar
Posted: Fri Jul 15, 2016 11:09 pm (GMT 5.5)

What is the problem here with DB2?
_________________
Regards,
Rohit Umarjikar
"Some things Man was never meant to know. For everything else, there's Google"

DB2 :: RE: DB2 FLOAT precision

$
0
0
Author: steve-myers
Posted: Fri Jul 15, 2016 11:20 pm (GMT 5.5)

I have no idea how DB2 stores floating point values. However, what you are describing is generic to floating point arithmetic in computers, and converting floating point values from decimal to binary and back to decimal. In general, it is not possible to convert something like 99.999 to an exact binary representation, and convert it back to 99.9990000. There are some exceptions. 99.50000 will convert exactly, and it should convert back to 99.5000000. However there is no “exact” conversion for most decimal fractions.

DB2 :: RE: DB2 CONNECT query

$
0
0
Author: Rohit Umarjikar
Posted: Sat Jul 16, 2016 2:33 am (GMT 5.5)

I am not sure why you needed daily Repair?
You will have to connect with your site DBA to see if REPAIR is essential on UNIX Box.
_________________
Regards,
Rohit Umarjikar
"Some things Man was never meant to know. For everything else, there's Google"

DB2 :: RE: DB2 FLOAT precision

$
0
0
Author: Robert Sample
Posted: Sat Jul 16, 2016 3:22 am (GMT 5.5)

Quote:
Want to know if this is a limitation with DB2 FLOAT and if it can be handled in any way.
This is because of how computers handle floating point, as otherwise stated, and there is nothing you can do about it. For example, 0.1 is an infinite repeating fraction in binary and hence CANNOT be precisely represented in floating point. If the issue is important, don't use floating point.
_________________
TANSTAAFL

The first rule of code reuse is that the code needs to be worth re-using.

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth


JCL & VSAM :: RE: CPU time Vs Number of records

$
0
0
Author: Nileshkul
Subject: Reply to: CPU time Vs Number of records
Posted: Sat Jul 16, 2016 7:45 am (GMT 5.5)

Thanks all - we have BSLR, THANKS FOR ALL HELP

DB2 :: LIKE vs EQUAL

$
0
0
Author: Nileshkul
Subject: LIKE vs EQUAL
Posted: Sat Jul 16, 2016 7:50 am (GMT 5.5)

Dear all,

I have a query which uses LIKE in WHERE clause for 4 character comparision.
Some thing like:
Where column1 LIKE :HOST1
Here character 2 to 4 are populated with _ underscore as wild char based on user input.
But many times - all 4 character are populated propely and nit wild so will use of EQUAL instead LIKE give better result.
Thanks.

DB2 :: RE: LIKE vs EQUAL

$
0
0
Author: Nileshkul
Subject: Update on query Like vs Equal
Posted: Sat Jul 16, 2016 2:46 pm (GMT 5.5)

Just to be clear - I want to know if equal to perform better than Like given that there is no wild card in Like host variable.
By performance, I mean whether Equal to will take less CPU than Like without wild card characters

DB2 :: Need help on SQL Dynamic WHERE Clause

$
0
0
Author: subratarec
Subject: Need help on SQL Dynamic WHERE Clause
Posted: Sat Jul 16, 2016 3:11 pm (GMT 5.5)

Hi All,

I have a query on SQL SELECT. I will try to describe the scenario as clear as possible from my end.

Scenario:
-------------------------------------------------------------------------------------
one CICS screen. In that screen earlier there was only one search criteria - "POLICY ISSUE DATE". When user will provide the date and hit enter it will LINK to another program where we have one SQL SELECT query with one WHERE clause (POLICY ISSUE DATE) and it will fetch the data.

But now we have included another 6 different criteria along with POLICY ISSUE DATE (so in total 7) and my client wants to give all flexibility to the user on choosing his/her search. Means User can fill one or two or all (any combination) and rest is same (Enter and it will LINK to subprogram)

Now as user can choose any combination of search from CICS Screen how should I go ahead and build dynamic WHERE clause (means if User has chosen one then SQL WHERE should work with that one if many then it should work with many)

It's a COBOL DB2 CICS program. There is only one DB2 table (MASTER_POLICY) Different filelds are listed below

Code:
POLICY START DATE
POLICY END DATE
POLICY HOLDER NAME
POLICY ID
COD
POLICY SETTLE START DATE
POLICY SETTLE END DATE


Earlier SQL:
--------------------------
Code:
SELECT * FROM <HL SCHEMA>.MASTER_POLICY  WHERE POLICY_START_DATE = <user given date>


But as there are many options now which approach should be the best/efficient to create an SQL SELECT which can have flexibile WHERE clause.

Could someone please guide me on this? Which approach should I take (if possible with small examples). Please let me know anymore info needed.

Thanks

DB2 :: RE: LIKE vs EQUAL

$
0
0
Author: Nic Clouston
Posted: Sat Jul 16, 2016 5:13 pm (GMT 5.5)

What happened when you tried a simple test?
_________________
Regards
Nic

Viewing all 8500 articles
Browse latest View live