MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Update a PD Value in a File

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Dec 15, 2006 7:40 am    Post subject: Update a PD Value in a File Reply with quote

Hai All,

I need to overlay File contents which is Packed Decimal and i want to say have the value in +40464.54 in positions 4 to 10 and i have a specific condition.
Code:

  SORT FIELDS=COPY                                                     
  OUTFIL IFTHEN=(WHEN=(1,3,CH,EQ,C'ABC'),                   
         OVERLAY=(4:C'------'))

I am showing ------ for test purpose


I want to know how to do as i was not able to achieve it and can i know the different ways of doing it without any Tool.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Dec 15, 2006 8:08 am    Post subject: Reply with quote

shekar123,

Try this

Code:

//STEP0100 EXEC PGM=SORT                       
//SYSOUT    DD SYSOUT=*                       
//SORTIN    DD *                               
ABC                                           
DEF                                           
GHI                                           
//SORTOUT   DD SYSOUT=*                       
//SYSIN     DD *                               
  SORT FIELDS=COPY                             
  OUTREC IFTHEN=(WHEN=(1,3,CH,EQ,C'ABC'),     
           OVERLAY=(4:+4046454,TO=PD,LENGTH=7))
/*                                             


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Dec 15, 2006 8:26 am    Post subject: Reply with quote

Fileaid solution:

Code:

//STEP0100 EXEC PGM=FILEAID                                     
//SYSPRINT DD SYSOUT=*                                         
//DD01     DD *                                                 
ABC                                                             
DEF                                                             
GHI                                                             
//DD01O    DD SYSOUT=*                                         
//SYSIN    DD *                                                 
$$DD01 COPYALL IF=(1,EQ,C'ABC'),REPL=(4,X'0000004046454C'),OUT=0
/*                                                             


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Dec 15, 2006 8:30 am    Post subject: Reply with quote

Kolusu,

Thanks for your reply .I was missing some part of the syntax but now i clear.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
madisand
Beginner


Joined: 29 Aug 2005
Posts: 19
Topics: 7

PostPosted: Thu Dec 28, 2006 12:02 am    Post subject: Reply with quote

Hi,

Does this control parameter IFTHEN is specific to DFSORT only & fails with Syncsort. At my work place the sort utility used is syncsort & I am getting a following abend message
Code:

  SORT FIELDS=COPY                                   
  OUTREC IFTHEN=(WHEN=(1,3,ZD,EQ,000),           
         *                                           
            OVERLAY=(28:0000000000,TO=PD,LENGTH=10))
WER268A  OUTREC STATEMENT  : SYNTAX ERROR           
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000       
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Dec 28, 2006 7:16 am    Post subject: Reply with quote

madisand,

Your version of syncsort does not support IFTHEN syntax. You need Syncsort for Z/OS 1.2 and higher.

Try these control cards assuming that your input file is 80 bytes Fb recfm

Code:

//SYSIN     DD *                               
  SORT FIELDS=COPY                             
  OUTREC FIELDS=(1,3,
                 4:1,3,CHANGE=(7,C'ABC',X'0000004046454C'),
                       NOMATCH=(4,7),
                 11,70)
/* 


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group