Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us