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

Replace packed decimal field with zeroes


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Fri Oct 12, 2007 1:37 am
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
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 Developer


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

PostPosted: Fri Oct 12, 2007 1:57 am
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:

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
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 Developer


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

PostPosted: Fri Oct 12, 2007 2:17 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
Search our Forums:

Back to Top