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
 

 

Replace packed decimal field with zeroes

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

New User


Joined: 11 Oct 2007
Posts: 7
Location: Cincinnati, OH

PostPosted: Fri Oct 12, 2007 1:28 am    Post subject: Replace packed decimal field with zeroes
Reply with quote

Need to replace packed decimal field with zeroes. Can this be done with OUTFIL? or inrec/outrec? Any example would be appreciated!
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: Fri Oct 12, 2007 1:37 am    Post subject:
Reply with quote

A little more detail would have been helpful.

Let's say you want to replace a PD field in positions 11-15 with PD zeros. You can use INREC, OUTREC or OUTFIL OVERLAY to do it. For example, you could use these DFSORT statements:

Code:

   OPTION COPY
   INREC OVERLAY=(11:+0,TO=PD,LENGTH=5)


or these DFSORT statements:

Code:

   OPTION COPY
   INREC OVERLAY=(11:X'000000000C')


If you need more specific help, give more details of what you're trying to do.
Back to top
View user's profile Send private message
Lkmi

New User


Joined: 04 Mar 2005
Posts: 53
Location: Newyork

PostPosted: Fri Oct 12, 2007 1:44 am    Post subject:
Reply with quote

I have a similar scenario, I am creating an output file and I need packed zeroes at the 21st character of teh output file.
when this file is read, the packed zeroes will be read into PIC S9(15)V9(3) COMP-3. How do I create the packed zeroes in the o/p file??
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: Fri Oct 12, 2007 1:57 am    Post subject:
Reply with quote

PIC S9(15)V9(3) COMP-3 is a 10-byte PD field. So the DFSORT statements would be:

Code:

   OPTION COPY
   INREC OVERLAY=(21:+0,TO=PD,LENGTH=10)


For more information on DFSORT formats vs COBOL formats, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/C.3?DT=20060615185603
Back to top
View user's profile Send private message
Lkmi

New User


Joined: 04 Mar 2005
Posts: 53
Location: Newyork

PostPosted: Fri Oct 12, 2007 2:06 am    Post subject:
Reply with quote

Iam trying to create the ourec from the input file. But for positions, 194:10 char in o/p file and similarly for 212:4 char, 285:10 chars, there is no input in the inrec and i have to create the output with packed zeroes
Is the below syntax correct??

SORT FIELDS=(181,16,CH,A)
OUTFIL FILES=02,
INCLUDE=(33,9,CH,EQ,C'EXFORDC04'),
OUTREC=(11,10,
15:C'MLCND ACCT ',C' MLCND',42,91,2Z,129:133,64,
194:+0,TO=PD,LENGTH=10
,8X,
212:+0,TO=PD,LENGTH=4
,70X,
285:+0,TO=PD,LENGTH=10,
294:33,9,21,12)
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: Fri Oct 12, 2007 2:17 am    Post subject:
Reply with quote

Quote:
Is the below syntax correct??


No, you have syntax errors (missing commas and 294: overlaps the previous field) and unneeded nX fields.

These DFSORT statements will run ok, but since I don't know everything you're trying to do, I can't say if it will do what you want.

Code:

  SORT FIELDS=(181,16,CH,A)                                     
  OUTFIL FILES=02,                                             
     INCLUDE=(33,9,CH,EQ,C'EXFORDC04'),                         
     OUTREC=(11,10,                                             
          15:C'MLCND ACCT  ',C'    MLCND',42,91,2Z,129:133,64, 
          194:+0,TO=PD,LENGTH=10,                               
          212:+0,TO=PD,LENGTH=4,                               
          285:+0,TO=PD,LENGTH=10,                               
          295:33,9,21,12)                                       
Back to top
View user's profile Send private message
Lkmi

New User


Joined: 04 Mar 2005
Posts: 53
Location: Newyork

PostPosted: Fri Oct 12, 2007 2:21 am    Post subject:
Reply with quote

Thanks Frank..I'll check the field's.
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 SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm


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