IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Comp-3 filed comparison in file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Deepa.m

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Mon Feb 12, 2007 2:34 pm
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: 3156
Location: Tucson AZ

PostPosted: Mon Feb 12, 2007 3:13 pm
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Feb 12, 2007 9:32 pm
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

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Tue Feb 13, 2007 6:53 pm
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: 3156
Location: Tucson AZ

PostPosted: Tue Feb 13, 2007 7:40 pm
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 13, 2007 8:38 pm
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 Developer


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

PostPosted: Tue Feb 13, 2007 10:21 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top