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
 

 

SYNCSORT matching logic!! - S0C7

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Sun Sep 16, 2007 12:42 am    Post subject: SYNCSORT matching logic!! - S0C7
Reply with quote

Hi,

I am gettinga a S0C7 error while adding two fields. The details are as below.

Inputs:
MED HRA 0000000050{
PHM HRA 0000000000

COMPUTE DTL-TOT-HRA-AT =
MED-HRA-AT + PHM-HRA-AT.

Copy book:
05 DTL-MD-HRA-AT-X PIC X(11).
05 MED-HRA-AT REDEFINES DTL-MD-HRA-AT-X
PIC S9(09)V9(02).
05 DTL-PHM-HRA-AT-X PIC X(11).
05 PHM-HRA-AT REDEFINES DTL-PHM-HRA-AT-X
PIC S9(09)V9(02).
05 DTL-TOT-HRA-AT-X PIC X(11).
05 TOT-HRA-AT REDEFINES DTL-TOT-HRA-AT-X
PIC S9(09)V9(02).

Error messgae: A decimal digit or sign was invalid.

More details:
JOINKEYS FILES=F1,FIELDS=(01,05,A,06,30,A,51,20,A,
119,08,A,127,08,A)
JOINKEYS FILES=F2,FIELDS=(01,05,A,06,30,A,51,20,A,
119,08,A,127,08,A)
REFORMAT FIELDS=(F1:1,500,F2:1,500),FILL=X'FF'
JOIN UNPAIRED
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(501,1,BI,EQ,X'FF'),
OUTREC=(1,76,6Z,83,418)
OUTFIL FILES=02,INCLUDE=(1,1,BI,EQ,X'FF'),
OUTREC=(501,70,6Z,577,424)
OUTFIL FILES=03,INCLUDE=(1,1,BI,NE,X'FF',AND,501,1,CH,NE,X'FF'),
OUTREC=(1,76,577,6,83,102,316X)

Case1: I am just comparing two files, FILE1 and FILE2. FILE1 contains MED HRA(PD) and FILE2 contains PHM HRA(PD). If a record is present in both the files, I'm taking MED HRA from FILE1 and PHM HRA from FILE2 and then writing that record to output file.

Case2: If a record on FILE1 doesn't find a match on FILE2, I want to move "zeros" into PHM HRA. But here I want to treat the "zero" values to be populated as PD.

Case3: In the same way, If a record on FILE2 doesn't find a match on FILE1, I want to move "zeros" into MED HRA. Aagain I want to treat the "zero" values to be populated as PD.

SORT FIELDS=(01,05,CH,A,06,30,CH,A,
51,20,CH,A,119,08,CH,A,127,08,CH,A)

OUTREC FIELDS=(1:C'DTL',4:135,50,54:C'00990',
59:C'CAREMARK ',74:6,30,104:51,20,124:36,15,
139:104,15,154:89,15,
169:71,6,PD,TO=ZD,LENGTH=11,
180:77,6,PD,TO=ZD,LENGTH=11,
191:83,6,PD,TO=ZD,LENGTH=11,
202:119,8,210:127,8,218:143X)

I'm merging all these records in some other step and then converting these two PD fields (MED HRA, PHM HRA) in addition to some other field into ZD fields before sending them to the actual program.

The program will sum up MED HRA and PHM HRA on each and every record and them will move the same to some other compatiable field (TOT HRA) for some other purpose. So here i'm getting the problem.

When I displayed the values, they appear to be valid, but the program is abending with a S0C7 error. I guess some where some thing is going wrong.

I believe I have provided all the details required. Its a bit urgent. Could any body help me out in this regard.
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: Sun Sep 16, 2007 1:29 am    Post subject:
Reply with quote

Hello,

Quote:
I believe I have provided all the details required
Not quite yet. . .

If the abend is happening in a cobol program, it will help if you post the data layout. The "copybook" posted does not appear match the sort definitions. The abending procedure code may help as well.

The problem data record also needs to be posted (in hex).

The various cases may help later, but the first thing to do is resolve the 0c7.

When you post code or data, use the "Code" tab near the top of the reply panel. This will preserve alignment and make your post more readable. To see your post as we will see it in the forum, click Preview. When you are satisfied with how your post appears, click Submit.
Back to top
View user's profile Send private message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Sun Sep 16, 2007 2:10 am    Post subject: Data layout
Reply with quote

Hi Dick,

Thanks for looking into this. Pl find the detials as you requested below. It appears to be the problem is with "zero" values which i'm populating into MED HRA/PHM HRA in the SORT. If you could see the PHM HRA values provided below, i'm missing the sign for PHM HRA (2nd field) on the file. I could see a space for that position. However if you could help me out that would be greatful to me.

Data layout:
Code:
01  AJRCMI-DETAIL

05 DTL-REC-TYPE-CD        PIC X(03).         
05 DTL-DET-UNIQUE-ID      PIC X(50).         
05 DTL-DAT-FL-SEND-ID     PIC X(05).         
05 DTL-DAT-FL-SEND-NM     PIC X(15).         
05 DTL-CLIENT-CD          PIC X(30).         
05 DTL-FAMILY-ID          PIC X(20).         
05 DTL-CARRIER-CD         PIC X(15).         
05 DTL-ACCOUNT-NB         PIC X(15).         
05 DTL-GROUP-CD           PIC X(15).         
05 DTL-MD-HRA-AT-X        PIC X(11).         
05 DTL-MD-HRA-AT REDEFINES DTL-MD-HRA-AT-X   
                          PIC S9(09)V9(02). 
05 DTL-PHM-HRA-AT-X       PIC X(11).         
05 DTL-PHM-HRA-AT REDEFINES DTL-PHM-HRA-AT-X
                          PIC S9(09)V9(02). 
05 DTL-TOT-HRA-AT-X       PIC X(11).         
05 DTL-TOT-HRA-AT REDEFINES DTL-TOT-HRA-AT-X
                          PIC S9(09)V9(02). 
05 DTL-BENEFIT-START-DT   PIC X(08). 
05 DTL-BENEFIT-END-DT     PIC X(08).
05 FILLER                 PIC X(143).

Dump:
Code:
Address  Offset     Hex                                 EBCDIC           
-------- ---------  ----------------------------------- ------------------
0EBD1EE0            C4E3D3E3 C47BF5F6 F960C2C3 C2E240E2 *DTLTD#569-BCBS S*
0EBD1EF0       +10  C340C8D9 C1F64040 40404040 40404040 *C HRA6          *
0EBD1F00       +20  40404040 40404040 40404040 40404040 *                *
0EBD1F10       +30  40404040 40F0F0F9 F9F0C3C1 D9C5D4C1 *     00990CAREMA*
0EBD1F20       +40  D9D24040 40404040 40404040 40404040 *RK              *
0EBD1F30       +50  40404040 40404040 40404040 40404040 *                *
      Line 0EBD1F40 same as above                                         
0EBD1F50       +70  40404040 40404040 404040F7 F0F2F140 *           7021 *
0EBD1F60       +80  40404040 40404040 40404040 40404040 *                *
      Line 0EBD1F70 same as above                                         
0EBD1F80       +A0  40404040 40404040 F0F0F0F0 F0F0F0F0 *        00000000*
0EBD1F90       +B0  F5F0C0F0 F0F0F0F0 F0F0F0F0 F000F0F0 *50{0000000000.00*
0EBD1FA0       +C0  F0F0F0F0 F0F1F0F0 C0F2F0F0 F6F0F1F0 *00000100{2006010*
0EBD1FB0       +D0  F1F2F0F0 F7F0F6F3 F0404040 40404040 *120070630       *
0EBD1FC0       +E0  40404040 40404040 40404040 40404040 *                *
      Lines 0EBD1FD0-0EBD2030 same as above                               
0EBD2040      +160  40404040 40404040                   *                *



HRA values on the file:
Code:
MED HRA      PHM HRA     TOT HRA (initially this field can contain any values)     
0000000050{0000000000 0000000100{
0000000000{0000000000 0000000100}
0000005000}0000000000 0000005000}
0000005148H0000000000 0000012483J
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: Sun Sep 16, 2007 2:50 am    Post subject:
Reply with quote

Hi Reddy,

Please look at your previous post (the one before this reply) and notice the black background and green print (that also is aligned). This is done by using the "Code" tab i mentioned earlier.

Your "bad" data value is x'00' - not a space (x'40').

What do the packed-decimal fields have in them?
Back to top
View user's profile Send private message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Sun Sep 16, 2007 3:04 am    Post subject: An update on S0C7
Reply with quote

Hi Dick,

I just modified the value for PHM HRA to have '{' in the balnk position to treat the value as +ve and then tried. The program executed with out any errors.

MED HRA PHM HRA TOT HRA
0000000050{0000000000{0000000100{
0000000000{0000000000{0000000100}
0000005000}0000000000{0000005000}

For both I/P and O/P I use the same data layout. When I opebed the i/p file using the data layout, I am able to see all the values properly.

The program does sum up MED HRA and PHM HRA and populate TOT HRA and then create a HDR and TRL. But when I opened the O/P file using the same layout, I can't see the values for the same amount fields. But i'm able to see the values for the rest of the fields on the O/P file using the same layout other than these three. Also when I directly opened the file with out using the data layout I could see the values for the three fields.

Q1. How can I tell the SORT that treat the "zero" values which i'm populating into MED HRA/PHM HRA(PD) as positive (using PD format).

Q2. Whats happening to the values of MED HRA, PHM HRA and TOT HRA on the O/P file.

Pl let me knoe if you want me to provide any more details.
Back to top
View user's profile Send private message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Sun Sep 16, 2007 3:24 am    Post subject:
Reply with quote

Yes Dick, henceforth I will follow the suggetions given by you while posting a Q.

I am sure I will not have any issues for all the matching records on FILE1 and FILE2. However the problem is with the un matching records on both the files for which i'm trying to populate "zero" values.

How can I take care of this "bad" data value x'00'. This is happening for all the un matching records on both FILE1 nad FILE2. For whatever the record i'm trying to populate "zeros" into MED/PHM HRA, I am getting into a prob.

Could you pl let me know if there is a way to get rid of this bad data prob.
Back to top
View user's profile Send private message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Sun Sep 16, 2007 4:21 am    Post subject:
Reply with quote

Hi,

Except the bad data problem for the "zero" values which i'm populating into MED/PHM HRA, all the things are working fine.

Code:
Step1:
JOINKEYS FILES=F1,FIELDS=(01,05,A,06,30,A,51,20,A,
119,08,A,127,08,A)
JOINKEYS FILES=F2,FIELDS=(01,05,A,06,30,A,51,20,A,
119,08,A,127,08,A)
REFORMAT FIELDS=(F1:1,500,F2:1,500),FILL=X'FF'
JOIN UNPAIRED
SORT FIELDS=COPY

[b]OUTFIL FILES=01,INCLUDE=(501,1,BI,EQ,X'FF'),
OUTREC=(1,76,6Z,83,418)
OUTFIL FILES=02,INCLUDE=(1,1,BI,EQ,X'FF'),
OUTREC=(501,70,6Z,577,424) [/b]

OUTFIL FILES=03,INCLUDE=(1,1,BI,NE,X'FF',AND,501,1,CH,NE,X'FF'),
OUTREC=(1,76,577,6,83,102,316X)

Step2:
SORT FIELDS=(01,05,CH,A,06,30,CH,A,
51,20,CH,A,119,08,CH,A,127,08,CH,A)

OUTREC FIELDS=(1:C'DTL',4:135,50,54:C'00990',
59:C'CAREMARK ',74:6,30,104:51,20,124:36,15,
139:104,15,154:89,15,

[b]169:71,6,PD,TO=ZD,LENGTH=11,
180:77,6,PD,TO=ZD,LENGTH=11, [/b]

191:83,6,PD,TO=ZD,LENGTH=11,
202:119,8,210:127,8,218:143X)


In Step1, the code hilighted in BOLD will explicitly move "zeros" into PHM HRA (DECIMAL (11,2)) on the first OUTFIL. The second OUTFIL will explicitly move "zeros" into MED HRA (DECIMAL (11,2)) for all the un mnmatching records on FILE2. Both MED HRA and PHRM are PD fields.

I just want o know if there is a way to tell the SORT to treat the "zero" values as PD(DECIMAL (11,2)) .

In Step2, the code hilighted in BOLD will convert PD fields to ZD(S9(9)V9(2)) to match to the copy book in my program.
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: Sun Sep 16, 2007 5:50 am    Post subject:
Reply with quote

Hi Reddy,

Quote:
I just want o know if there is a way to tell the SORT to treat the "zero" values as PD(DECIMAL (11,2))
I'm sure there is a way, but i do not know the syntax. You would want to initialize a PD field with zeros.

As a workaround for a short time, you could check the value in the cobol program and if the field has the "bad" value (with the zeros and the x'00'), move zeros to it. I would not recommend doing this for a long-term production solution, but it would move you beyond the 0c7.
Back to top
View user's profile Send private message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Sun Sep 16, 2007 6:30 am    Post subject:
Reply with quote

Hi Dick,

This logic is working fine. But I am looking out for a permanent and most reliable solution as this is going live in the next week. The no of i/p records could even be in millions. So any of the amount fields(MED/PHM HRA) should not get impacted because of this change.

I even tried with some hexa decimal values for populating zeros along with a sign, but i couldn't succeed. I tried with x'00000C', but it is causing some LRECL truncation.

If you could let me know the reliable solution, that would be really helpful to me.
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: Sun Sep 16, 2007 6:48 am    Post subject:
Reply with quote

Hi Reddy,

Quote:
I tried with x'00000C',
This is the right idea, but you would need x'00000000000C' for a s9(9)v99 PD/comp-3 value of +zero.
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: Sun Sep 16, 2007 6:53 am    Post subject:
Reply with quote

To add to the previous. . .

Viewed with HEX ON (in tso/ispf) it would look like
Code:
000000
00000C

eleven nibbles (half-bytes) of zeros and a positive sign (C) in the least significant nibble.
Back to top
View user's profile Send private message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Sun Sep 16, 2007 3:52 pm    Post subject: Reply to: SYNCSORT matching logic!! - S0C7
Reply with quote

Dick,

It's working fine. Thanks for your continuous help in getting this resolved.
With out your help I wouldn't have completed this.
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: Sun Sep 16, 2007 10:20 pm    Post subject:
Reply with quote

You're welcome icon_smile.gif

Good to hear that it is working correctly icon_biggrin.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Matching with Key at different postions. rajatbagga DFSORT/ICETOOL 12 Wed Nov 09, 2016 10:58 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


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