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
 

 

Selection For Comp-3 fileds

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

New User


Joined: 27 Mar 2006
Posts: 31

PostPosted: Wed Apr 28, 2010 5:43 am    Post subject: Selection For Comp-3 fileds
Reply with quote

Hi,

I have one variable :

GOD53-ORD-NO-- PIC S9(10)V USAGE COMP-3.

and in my input file this filds has millions of records , I want to pick up one which has the value : 520565. And I have written the following sort to get the data but some how its not working , could you please tell me that what will be the correct syntex for this :

171,6,PD,EQ,'520565')


--171-Starting postion
--6-total length of the field.
--PD -because its a COMP-3.

Note : I tried couple of options by giving
171,6,PD,EQ,X'520565') and 171,6,PD,EQ,P'520565') AND BY giving leading zero in 520565 to make it look like file value, but no success.
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 28, 2010 6:16 am    Post subject:
Reply with quote

Have you tried it without the quotes, such as 171,6,PD,EQ,+520565)?

How about posting the cut&paste of your JCL and all the output from the logs?
Back to top
View user's profile Send private message
harry

New User


Joined: 27 Mar 2006
Posts: 31

PostPosted: Wed Apr 28, 2010 6:22 am    Post subject:
Reply with quote

Q-Have you tried it without the quotes ?

Ans: yes I did ..

this is the copy paste of the jcl ;

===========================================

SORT FIELDS=COPY
INCLUDE COND=
((115,18,CH,EQ,C'77901TA0 A000 ',OR, <<PART NUMBER
115,18,CH,EQ,C'77901TA0 A100 '),AND, <<PART NUMBER
96,6,CH,EQ,C'210560',AND, <<<SUPP-CD
102,2,CH,EQ,C'01',AND, <<<SUPP-LOC
Quote:
171,6,PD,EQ,X'520565') <<<ORD-NUMBER

*
Back to top
View user's profile Send private message
harry

New User


Joined: 27 Mar 2006
Posts: 31

PostPosted: Wed Apr 28, 2010 6:27 am    Post subject:
Reply with quote

ERROR LOG

Code:
SYNCSORT FOR Z/OS  1.3.2.1R   
 2007 SYNC
                                                      z/OS   1.11.0         
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 434F0, MODEL 2094 605             LIC
SYSIN :                                                                     
=============================================
  SORT   FIELDS=COPY                                                         
  INCLUDE COND=((115,18,CH,EQ,C'77901TA0 A000     ',OR, <<PART NUMBER       
                115,18,CH,EQ,C'77901TA0 A100     '),AND, <<PART NUMBER       
                96,6,CH,EQ,C'210560',AND,              <<<SUPP-CD           
                102,2,CH,EQ,C'01',AND,                 <<<SUPP-LOC           
                171,6,PD,EQ,X'520565')                 <<<ORD-NUMBER         
                            *                                               
WER253A  INCLUDE/OMIT FORMATS INCOMPATIBLE                                   
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                               


WER253A  INCLUDE/OMIT FORMATS INCOMPATIBLE       
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Apr 28, 2010 6:31 am    Post subject:
Reply with quote

Hi,

what happened when you tried it without the quotes ?


Gerry
Back to top
View user's profile Send private message
harry

New User


Joined: 27 Mar 2006
Posts: 31

PostPosted: Wed Apr 28, 2010 6:40 am    Post subject:
Reply with quote

gcicchet wrote:
Hi,

what happened when you tried it without the quotes ?


Gerry


Tired two option based on your comment : both gave MAXCC=0 but no results , I am 100% sure about my starting position and rec-length so what i think is its not understanding the value of ord-number , any idea is there different way to write COMP-3 ??? my value is =

Code:
===========
000255
00506C            which is nothing but 520565
==========


Option-1

  INCLUDE COND=((115,18,CH,EQ,C'77901TA0 A000     ',OR, <<PART NUMBER 
                115,18,CH,EQ,C'77901TA0 A000     '),AND, <<PART NUMBER
                96,6,CH,EQ,C'210560',AND,              <<<SUPP-CD     
                102,2,CH,EQ,C'01',AND,                 <<<SUPP-LOC     
                171,6,PD,EQ,00000520565)               <<ORD-NUMBER   

option-2

INCLUDE COND=((115,18,CH,EQ,C'77901TA0 A000     ',OR, <<PART NUMBER
              115,18,CH,EQ,C'77901TA0 A000     '),AND, <<PART NUMBER
              96,6,CH,EQ,C'210560',AND,              <<<SUPP-CD     
              102,2,CH,EQ,C'01',AND,                 <<<SUPP-LOC   
              171,6,PD,EQ,520565)               <<ORD-NUMBER       
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Apr 28, 2010 7:04 am    Post subject:
Reply with quote

Hi,

is the file FB or VB ?

Have you tried selecting 1 single field to see if you have the correct starting positions ?

Also 115,18, means you are searching from 115-132, the string you are searching for is only 14 bytes long C'77901TA0 A000 ' so unless 129-132
has spaces in it, you will not select anything.


Gerry
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 28, 2010 7:12 am    Post subject:
Reply with quote

harry wrote:
Code:
                171,6,PD,EQ,X'520565')                 <<<ORD-NUMBER         
                            *                                               
WER253A  INCLUDE/OMIT FORMATS
This is without quotes?
harry wrote:
Code:
Option-1
.
                171,6,PD,EQ,00000520565)               <<ORD-NUMBER   
.
option-2
.
              171,6,PD,EQ,520565)               <<ORD-NUMBER       
Either should work, since there are no error messages with them, right?

I suggest you display/browse the input file and 'hex on' and cut&paste the first screen of data and the screen centering on position 171.

Please post the current JCL and the sysouts produced by the run with that JCL and the results that "gave MAXCC=0 but no results".

By the way, just cur &paste and wrap in 'code' rather than 'quote'. And no bolding/underlining/color/font size is needed, we can find the needed info without that stuff........
Back to top
View user's profile Send private message
harry

New User


Joined: 27 Mar 2006
Posts: 31

PostPosted: Wed Apr 28, 2010 7:15 am    Post subject:
Reply with quote

Quote:
Hi,

is the file FB or VB ?

Have you tried selecting 1 single field to see if you have the correct starting positions ?

Also 115,18, means you are searching from 115-132, the string you are searching for is only 14 bytes long C'77901TA0 A000 ' so unless 129-132
has spaces in it, you will not select anything.
Quote:


Ans:

Ans-1 : This is a FB,

Ans-2 :
Yes 115,18 fields is correct , I ran it more than 100 times and after removing my LAST SORT CONDTION and it works fine. But this time finally I thought I should get the clarification from your all on how to use it .

When I remove the last sort condition on comp-3 filed i will get the proper result.

If you see carefully the Also 115,18 : till whatever position i have value i have given that and after that it has space to make it 18 BYTES. So trust me all the other sort conditions are correct the only problem is that COMP-3 SORT FIELD.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Apr 28, 2010 7:19 am    Post subject:
Reply with quote

Hi,

your original post did not have the additional spaces to make it 18 bytes,

have you tried selecting the PD field only ?

Gerry
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Apr 28, 2010 7:30 am    Post subject:
Reply with quote

As CICS Guy mentioned, please post a record of the input......

Quote:
your original post did not have the additional spaces to make it 18 bytes,
Padded with leading blanks.....
Back to top
View user's profile Send private message
harry

New User


Joined: 27 Mar 2006
Posts: 31

PostPosted: Wed Apr 28, 2010 7:46 am    Post subject: BILLIONS OF THANKS
Reply with quote

Guys it seems it work, as MR. gcicchet, suggested that try without quotes: at that time it gave the MAXCC=0 and when I checked output file , it was having nothing . And I assumed that my input file is having the data , but that was the wrong understanding because I have deleted that input file in my first delete statement.

Just now I again tried the same thing , full input file comp-3 filed as

171,6,PD,EQ,520565) <<<ORD-NUMBER

It worked man,

BILLIONS OF THANKS .

[color=red]special thanks to CICS Guy, gcicchet, William Thompson . [/color]
icon_biggrin.gif icon_biggrin.gif

==============================================
Learning from this post :

Question : If we want to select some COMP-3 filed and give the value on the sort card what is the syntax for the same ?

Ans:

Ex if your comp-3 field has definition PIC S9(10)V USAGE COMP-3. and YOU KNOW THE VALUE IS

000255
00506C

Which is 520565 THEN this is how it should be coded.


171,6,PD,EQ,520565) <<<<<<<<comp-3 field.

WHERE 171- Starting position .
6--- length of PIC S9(10)V USAGE COMP-3

PD—FOR COMP-3 DATA TYPE

EQ- your selection criteria it can be LT,GT,LE, OR ANY OTHER POSSIBLE OPTION.

520565- THIS WAS THE VALUE WHICH I WAS TRYING TO SELECT .


===============================================
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 28, 2010 8:05 am    Post subject:
Reply with quote

My, how wonderful that you have solve your problem, and colorful to boot....grin.....

Quote:
it seems it work, as MR. gcicchet, suggested that try without quotes
Congrats Gerry...... icon_lol.gif

Also should be "Learning from this post":
Quote:
By the way, just cur &paste and wrap in 'code' rather than 'quote'. And no bolding/underlining/color/font size is needed, we can find the needed info without that stuff........
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Apr 28, 2010 8:12 am    Post subject:
Reply with quote

Hi,

quote originated by CICS Guy

Quote:
Have you tried it without the quotes, such as 171,6,PD,EQ,+520565)?
so all KUDOS to CICS Guy icon_lol.gif icon_lol.gif


Gerry icon_redface.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 28, 2010 8:21 am    Post subject:
Reply with quote

All smiles, thanks Gerry....

Ain't this fun? icon_eek.gif icon_rolleyes.gif icon_lol.gif
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Apr 28, 2010 8:24 am    Post subject:
Reply with quote

Hi CICS Guy,

from Sydney Australia


Gerry
Back to top
View user's profile Send private message
harry

New User


Joined: 27 Mar 2006
Posts: 31

PostPosted: Wed Apr 28, 2010 8:27 am    Post subject:
Reply with quote

Hi,

Quote:
quote originated by CICS Guy


It was my mistake I should have looked into the input files correctly, just now i tried the first ans to this post


Quote:
Have you tried it without the quotes, such as 171,6,PD,EQ,+520565)?


and it has given the same results as 171,6,PD,EQ,520565). Just one question for my better understanding :

lets say this comp-3 field has some negative value then will i give (-) sign in the sort condition ?

e.g.
171,6,PD,EQ,-520565)? if i am selecting -520565 ?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 28, 2010 8:34 am    Post subject:
Reply with quote

Quote:
171,6,PD,EQ,-520565)? if i am selecting -520565 ?
Yup, you got it.
BTW, 520565 and +520565 are exactly the same in this application.
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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need help to populate date in COMP-3 ... chetanambi DFSORT/ICETOOL 3 Tue Jun 21, 2016 12:25 pm
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts SIGNED DECIMAL TO COMP-3 using cobol ... ram_vizag COBOL Programming 1 Tue Mar 01, 2016 11:32 pm


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