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
 

 

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

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

New User


Joined: 31 Oct 2006
Posts: 23
Location: brisbane

PostPosted: Thu Nov 02, 2006 11:06 am    Post subject: Add a value to a symbolic constant where it defines a offset
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 Moderator


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

PostPosted: Thu Nov 02, 2006 9:16 pm    Post subject:
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    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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
This topic is locked: you cannot edit posts or make replies. Put quotes in Symbolic parameter whil... Yashashri All Other Mainframe Topics 7 Mon Feb 15, 2016 12:24 pm
No new posts symbolic parm - allocate dsn krrp JCL & VSAM 11 Sat Oct 31, 2015 8:27 pm
No new posts Sort to subtract constant from variab... drarem DFSORT/ICETOOL 9 Wed Oct 21, 2015 1:08 am


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