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

Add a value to a symbolic constant where it defines a offset


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

Active User


Joined: 31 Oct 2006
Posts: 131
Location: brisbane

PostPosted: Thu Nov 02, 2006 11:06 am
Reply with quote

two questions (looked thru the tutorial guides, but could not find any helpful examples) -

1. Is it possible to add a value to a symbolic constant where it defines an offset


eg, instead of

OVERLAY=(49:f1_c_w) ...

I would prefer (for readability) something that achieves :

OVERLAY=((f2_c+5):f1_c_w) ...


2. Suppose I have a file with a column for year (say at 10,4) defined as type char (YYYY). I want to add a constant to the year value where the record matches some criteria, but leave the result as CHAR.
how can this be done within an OVERLAY ?

eg -
....
IFTHEN=(WHEN=(44,1,CH,EQ,C'Z'),
OVERLAY= ???
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: Thu Nov 02, 2006 9:16 pm
Reply with quote

1. I'm not sure I understand what you're trying to do, but here's an example of using f2_c_p5 as a symbolic constant representing the position of f2_c + 5. Note that + is not allowed in symbols, so I used p5 (for plus 5) instead.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD *
f1_c_w,5,8
f2_c,44
POSITION,f2_c
SKIP,5
f2_c_p5,*
/*
//SYMNOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(f2_c_p5:f1_c_w)
/*


The INREC statement will be translated to:

Code:

  INREC OVERLAY=(49:5,8)


2. Just treat the 4-byte YYYY value as ZD.

Code:

   IFTHEN=(WHEN=(44,1,CH,EQ,C'Z'),
     OVERLAY=(10:10,4,ZD,ADD,+n,TO=ZD,LENGTH=4))


where +n is the constant (you must use +n and not n).
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 pass data as symbolic parameter from ... CLIST & REXX 2
No new posts passing symbolic parameters through d... JCL & VSAM 3
No new posts Printing a dataset in DUMP format wit... ABENDS & Debugging 2
No new posts Selecting multiple constant records DB2 3
No new posts include cond ascii constant DFSORT/ICETOOL 4
Search our Forums:

Back to Top