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 

Replace a Specific string for a FB file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
mainframemouli
Beginner


Joined: 23 Feb 2005
Posts: 87
Topics: 33

PostPosted: Fri Sep 09, 2005 12:19 am    Post subject: Replace a Specific string for a FB file Reply with quote

I searched this site and tried to use this Jcl given below
Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                       
----+----1----+----2----+----3----+----4----+----5----+
+AAAAAAAAAA 0000001234   <==== your 254 lrecl file         
//SORTOUT  DD SYSOUT=*   
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                     
  OUTREC FIELDS=(1,12,                                 
                 13,6,CHANGE=(6,C'000000',C'BBBBBB'),   
                 NOMATCH=(13,6),                       
                 19,236)                               
/*


But i am getting a abend like i mentioned below
Code:

ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                               
ICE000I 1 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 01:17 ON FRI SEP
            SORT FIELDS=COPY                                                   
            OUTREC FIELDS=(1,12,                                               
                           13,6,CHANGE=(6,C'BBBBBB',C'AAAAAA'),NOMATCH=(13,6),
                           19,80                                               
                                $                                             
ICE007A 5 SYNTAX ERROR                                                         
                           )                                                   
                           $                                                   
ICE007A 1 SYNTAX ERROR                                                         
ICE052I 3 END OF DFSORT                                                       

What actually the problem is. My input file is like this

111111111111BBBBBB1111111111111111111111
111111111111BBBBBB1111111111111111111111
111111111111BBBBBB1111111111111111111111
111111111111BBBBBB1111111111111111111111

Please clarify this
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Sep 09, 2005 12:30 am    Post subject: Reply with quote

mainframemouli,

I really wonder how you got "19,80" in your sysout while your job says "19,236".

I think there are two errors in your code.
1. You need to leave the First Column as Blank in your SYSIN card.
2. You cannot have 19,80 alone in one line and ")" in another line. They should be in the same line.

Try these things and if you still get an error, post your correct JCL & the error message.

Thanks,
Phantom
Back to top
View user's profile Send private message
ANIL SARATHY
Beginner


Joined: 30 Aug 2005
Posts: 88
Topics: 3
Location: Syracuse,New york

PostPosted: Fri Sep 09, 2005 12:36 am    Post subject: Reply with quote

TRY OUT WITH POSITIONS
Code:

//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,12,
13:13,6,CHANGE=(6,C'000000',C'BBBBBB'),
NOMATCH=(13,6),
19:19,236)
/*

Smile
_________________
Anil Sarathy
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Sep 09, 2005 1:05 am    Post subject: Reply with quote

Anil,

Positions are not a problem in this case. Col 13 + 6 Chars ends in Col 18, so by default 19,236 will start at Col 19 in the output also. If it really were a problem with positions then the error message would be "OUTREC HAS OVERLAPPING COLUMNS SPECIFIED"

Thanks,
Phantom
Back to top
View user's profile Send private message
mainframemouli
Beginner


Joined: 23 Feb 2005
Posts: 87
Topics: 33

PostPosted: Fri Sep 09, 2005 4:53 am    Post subject: Reply with quote

As anil said i made the changes still it gives the error
Note : My Record LRECL is 80.

ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE000I 1 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 05:48 ON FRI SEP
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,12,
13:13,6,CHANGE=(6,C'000000',C'BBBBBB'),
NOMATCH=(13,6),
19:19,80)
ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE027A 6 END OF FIELD BEYOND MAXIMUM RECORD LENGTH
ICE052I 3 END OF DFSORT

-------------------------------

And as phantom said the Jcl is exceuted still i am getting the error
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE000I 1 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 05:46 ON FRI SEP
SORT FIELDS=COPY
OUTREC FIELDS=(1,12,
13,6,CHANGE=(6,C'BBBBBB',C'AAAAAA'),NOMATCH=(13,6),
19,80)
ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE027A 6 END OF FIELD BEYOND MAXIMUM RECORD LENGTH
ICE052I 3 END OF DFSORT

-----------------------

heres my Jcl.
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XT2.SMS.PAY.BATCH.SRC(SAMPLE1),DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,12,
13:13,6,CHANGE=(6,C'000000',C'BBBBBB'),
NOMATCH=(13,6),
19:19,80)
/*
//

Input file i have given already...
Back to top
View user's profile Send private message
mainframemouli
Beginner


Joined: 23 Feb 2005
Posts: 87
Topics: 33

PostPosted: Fri Sep 09, 2005 4:55 am    Post subject: Reply with quote

sorry it should be
CHANGE=(6,C'BBBBBB',C'000000')
for this one also i am getting the same abend...
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Sep 09, 2005 6:28 am    Post subject: Reply with quote

Quote:

Note : My Record LRECL is 80.

Mainframemouli,

The reason for the abend is because you are trying to copy beyond the actual LRECL of the file.

The outrec/inrec fields is of the following format

Code:

OUTREC FIELDS=(P,L)

where P = position of the field and L = length of the field.


Now let us see your control cards
Code:

 SORT FIELDS=COPY
 OUTREC FIELDS=(1,12,
                13,6,CHANGE=(6,C'000000',C'BBBBBB'),
                             NOMATCH=(13,6),
                19,80)


1,12 = copy first 12 bytes (So 80-12 = 68 bytes left to be copied )
your are changing the 6 bytes which starts from 13 (68-6 = 62 bytes left)
19,80 = you are trying to copy 80 bytes from pos 19 which makes the total lrecl to be 98 bytes, but your input file is only 80 bytes.

So change your control cards to the following.

Code:

 SORT FIELDS=COPY
 OUTREC FIELDS=(1,12,
                13,6,CHANGE=(6,C'000000',C'BBBBBB'),
                             NOMATCH=(13,6),
                19,62)


Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

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


Joined: 23 Feb 2005
Posts: 87
Topics: 33

PostPosted: Fri Sep 09, 2005 8:04 am    Post subject: Reply with quote

Thanks Kolusu , i really misunderstood the concept of
OUTREC FIELDS = ( p , l )

Now My job ran fine.

Suppose the same thing has to be done for VB file means what i have to do??
My VB LRECL is 850.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Sep 09, 2005 8:28 am    Post subject: Reply with quote

Quote:

Suppose the same thing has to be done for VB file means what i have to do??
My VB LRECL is 850.


Mainframemouli,

For VB files you need to consider the RDW and then you code your actual data fields. The actual data starts from pos5 as the first 4 bytes will be occupied by RDW. With VB files you don't have to mention the length in OUTREC FIELDS = ( p , l )

for ex:

If you have a VB file of lrecl 100. you want to insert a constant('abc') in the first 3 bytes. you will code

Code:

 SORT FIELDS=COPY
 OUTREC FIELDS=(1,4,      $ RDW
                C'ABC',   $ CONSTANT
                5)        $ ACTUAL DATA


If you notice , I did not mention the length portion on Actual data field as sort automatically will copy the record until the end for VB files

In your case lets assume that you want to perform similar processing as you did for your FB 80 byte file, the following control cards will give you the desired results.

Code:

 SORT FIELDS=COPY
 OUTREC FIELDS=(1,4,
                5,12,
                17,6,CHANGE=(6,C'000000',C'BBBBBB'),
                             NOMATCH=(17,6),
                23)


In the above control cards
Code:

1,4  = RDW
5,12 = copy the contents from pos5 for a length of 12 bytes
17,6,change = change the contents to bbbbbb when 000000 else copy the contents as is
23 = copy the contents from pos 23 till the end of the record


Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Sep 09, 2005 9:47 am    Post subject: Reply with quote

mainframemouli,

Well, I see all of your questions were answered before I even got to work. Smile

Since you seem to be unfamiliar with DFSORT syntax, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html

At that same link, you'll find "z/OS DFSORT Messages, Codes and Diagnosis Guide" where you can look up any DFSORT error message (ICExxxA) you get which may help you diagnose and fix errors yourself, and "z/OS DFSORT Application Programming Guide" which has the complete syntax for all of the DFSORT and ICETOOL statements and parameters.


Phantom wrote
Quote:
If it really were a problem with positions then the error message would be "OUTREC HAS OVERLAPPING COLUMNS SPECIFIED"


Actually, the DFSORT message for this situation would be:

ICE126A 2 INCONSISTENT *OUTREC IFTHEN 0 REFORMATTING FIELD FOUND
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mainframemouli
Beginner


Joined: 23 Feb 2005
Posts: 87
Topics: 33

PostPosted: Sat Sep 10, 2005 12:31 am    Post subject: Reply with quote

Thanks Frank and Kolusu,
I downloaded all the files for DFSORT as mentioned by Frank....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) 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