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
 

 

Do a lookup operation within a file

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

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Tue Apr 08, 2008 1:57 pm    Post subject: Do a lookup operation within a file
Reply with quote

I am trying to do a lookup operation within a file,

file1 is my input file with 1-9 chars as key and this same key may present in cols 51 thru 59. Now I need to change the rows which has the matching key with sum text and non-matching with some specified text.

If I hard code the values, its working fine... but if give the position of the key its not working... It says "ICE111A E REFORMATTING FIELD ERROR
".

//*===========================================================
//* LOOKUP
//*===========================================================
//S1 EXEC PGM=ICETOOL
//*
//SYSOUT DD SYSOUT=*
//I1 DD DSN=FILE1,DISP=SHR
//O1 DD DSN=FILE2,DISP=(OLD,CATLG,DELETE),
// SPACE=(CYL,(10,8),RLSE),RECFM=FB
//TOOLMSG DD SYSOUT=*
//SYMNOUT DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYMNAMES DD DSN=SAM.SYMBOLS,DISP=SHR
//TOOLIN DD *
COPY FROM(I1) TO(O1) USING(CT01)
/*

//CT01CNTL DD *
SORT FIELDS=COPY
OUTFIL FNAMES=O1,
OUTREC=(1,9,CHANGE=(9,A,B),
NOMATCH=(C'NOT FND'),1,650)
/*


Content of symbol file:

* FIELDS
A,1,9,CH
B,51,9,CH

Pls suggest...

Thanks in advance.

-Sam.
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 Apr 08, 2008 10:03 pm    Post subject:
Reply with quote

Well, you can't be using A for the symbol name because that's a reserved word and you'd get an error message for it. So assuming you're using something valid (like a), your CHANGE operand would be translated to:

1,9,CHANGE=(9,1,9,51,9)

This is NOT valid syntax for CHANGE. The format is (v,find,set) where v is the length (9 in your case), find is a constant and set is a field or constant. You have a field for find instead of a constant.

Quote:
If I hard code the values, its working fine


Not if you hardcoded (9,1,9,51,9). You'd get the same ICE111A.

If you're trying to change 1-9 to 'NOT FND' if it doesn't match 51-59, then you would do that with IFTHEN/OVERLAY as follows:

Code:

//S1    EXEC  PGM=ICETOOL
//SYSOUT DD  SYSOUT=*
//I1     DD DSN=...  input file
//O1     DD DSN=...  output file
//TOOLMSG      DD  SYSOUT=*
//DFSMSG       DD  SYSOUT=*
//TOOLIN       DD  *
COPY FROM(I1) TO(O1) USING(CT01)
/*
//CT01CNTL DD *
 OUTFIL FNAMES=O1,
   IFTHEN=(WHEN=(1,9,CH,NE,51,9,CH),OVERLAY=(1:C'NOT FND  '))
/*


You can, of course, use symbols if you like.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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