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
 

 

Comp-3 filed comparison in file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Mon Feb 12, 2007 2:34 pm    Post subject: Comp-3 filed comparison in file
Reply with quote

Hi all,

I have to compare certain account numbers with the transaction file and if present put them in a new file . quite simple..but my doubt is the transaction file has got accout number as comp-3 (packed decimal)

transaction file:
Acctnumber comp-3 length - 17 s9(9)

Code:

File A:
1---------------------17 (length)
00005468839272456
00675468839272456
06705468839272556
00005468839272556
00005468839272476
etc..



I have used hte below control card

Code:

//CON DSN=(trans file name),DISP=SHR
//    DD DSN=( file A),DISP=SHR                   
//CONOUT DD DSN=ULXX010.GB.BCSACORE.MCCEXTR.OUTPUT,       
SELECT FROM(CON) TO(CONOUT) ON(1,9,PD) FIRSTDUP


I have no idea about the actual acctnumbers in transaction file..so testing is a problem for me ..Everytime I am getting empty output file..which means that the account numbers are not found. Is my control card right or Am i missing something.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


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

PostPosted: Mon Feb 12, 2007 3:13 pm    Post subject: Re: Comp-3 filed comparison in file
Reply with quote

Deepa.m wrote:
Acctnumber comp-3 length - 17 s9(9)

SELECT FROM(CON) TO(CONOUT) ON(1,9,PD) FIRSTDUP

Is my control card right or Am i missing something.

S9(9) comp-3 is 5 bytes long, not 17 and not 9. Your example of the file
Code:
File A:
1---------------------17 (length)
00005468839272456
00675468839272456
06705468839272556
00005468839272556
00005468839272476
etc..
doesn't show packed fields, so I'm just a bit confused. Try your select with the knowledge of the correct length and let us know.
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: Mon Feb 12, 2007 9:32 pm    Post subject:
Reply with quote

Hello,

It appears that the "master" file has account number in display format while the transaction file has account number in a packed decimal field.
Quote:
transaction file:
Acctnumber comp-3 length - 17 s9(9)


I'm not sure what information the above quote provides. Is there an s(9) comp-3 field? Is there some reason for the sign?

The control statement does not take into account the 2 data types - it refers to PD only.

The 2 input files are concatenated but the record layouts are not the same. This means one of the record formats will not represent the control statement.

To see the account numbers in the transaction file, you can view it in tso. Set HEX ON and you will be able to see the packed values.

Please post all of the jcl and control statements for this step.
Back to top
View user's profile Send private message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Tue Feb 13, 2007 6:53 pm    Post subject: Re: Comp-3 filed comparison in file
Reply with quote

HI ,

I have explained about my file structure in detail.

1) Transaction file:

Accountnumber is of actual length 17 stored as comp-3 so first 9 bytes in transaction file has the account number.



Cols 1 ----- 9 |10 11 12 ----------62

acctnum |other details

2) Search file:
I have a list of account numbers (more than 100) and need to check its existence in the transaction file
example:

00042344567865325
00042344567865326
00042344565865327

how i can do this using icetool?

since both are in different formats I have to do format conversion before comparison.i stand corrected..thanks.

since comp-3 means packed decimal and 9(9) comp-3 stores about 17 digits. ( rite???)

select (in) to (out) on(1,9,pd) using cnt1cntl

//cnt1 dd *

(please provide me this control card)


Thanks,
Deepa
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Tue Feb 13, 2007 7:40 pm    Post subject:
Reply with quote

FWIW,
Quote:
since comp-3 means packed decimal and 9(9) comp-3 stores about 17 digits. ( rite???)
9(17) stores in 9 bytes.
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: Tue Feb 13, 2007 8:38 pm    Post subject:
Reply with quote

Hello,

Quote:
since comp-3 means packed decimal and 9(9) comp-3 stores about 17 digits. ( rite???)


Incorrect - 9(9) comp-3 stores 9 digits and takes 5 bytes (9 packed digits and the low order sign). To store 17 digits you need 9(17) comp-3 and that will take 9 bytes. There is no "about".

We don't have DFSORT/ICETOOL at this site so i can't run a test and show you the syntax. If you search the DFSORT forum you may find something very similar that will do what you want.

Frank? . . . . . icon_biggrin.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Feb 13, 2007 10:21 pm    Post subject:
Reply with quote

Deepa,

Here's a DFSORT/ICETOOL job that will do what you want based on the following assumptions about what that is:

1) Your transaction file has RECFM=FB and LRECL=62. It has a 9-byte PD account number in positions 1-9.

2) Your search file has RECFM=FB and LRECL=17. It has a 17-byte ZD account number in positions 1-17.

3) You want each record from the transaction file that has a matching account number in the search file.

Code:

//S1    EXEC  PGM=ICETOOL                                     
//TOOLMSG DD SYSOUT=*                                         
//DFSMSG  DD SYSOUT=*                                         
//IN2 DD DSN=...  search file (FB/17)                             
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)     
//CON DD DSN=... transaction file (FB/62)                             
//    DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)                 
//OUT  DD DSN=... output file (FB/62)                                             
//TOOLIN   DD    *                                             
COPY FROM(IN2) TO(T1) USING(CTL1)                             
SELECT FROM(CON) TO(OUT) ON(1,9,PD) FIRSTDUP                   
/*                                                             
//CTL1CNTL DD *                         
* Convert 17-byte ZD acctno to 9-byte PD acctno                     
  INREC BUILD=(1,17,ZD,TO=PD,LENGTH=9,62:X)                   
/*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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