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
 

 

Is it good to do the above task using SYNCSORT or COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Thu May 31, 2007 10:01 am    Post subject: Is it good to do the above task using SYNCSORT or COBOL
Reply with quote

Hi,

I am having a file with say n fields of which I have a field with a single alphabetic character. In the output file, I have to replace this alphabetic character with the corresponding number and with all the other fields remaining same. Could you please help me in doing this?

Moreover, my input file has millions of records. Whether it is good to do the above task using sort or COBOL program and which is efficient?

Thanks,
Bala
Back to top
View user's profile Send private message

muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Thu May 31, 2007 10:50 am    Post subject: Re: Help with Syncsort
Reply with quote

If it is a single replacement for ex:whether it is "a" ,"b" or "c" you are going to replace by it one number say "5" then you can use sort with OUTREC option.
If it is a replacement of different numbers for different alphabets then COBOL is preferable.
In case of efficiency test both(COBOL and Sort) and see which consumes less CPU time or elapsed time.
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Thu May 31, 2007 10:54 am    Post subject: Re: Help with Syncsort
Reply with quote

Hi,

It is like replacing different alphabets with different numbers.
I would like to know whether this can be done by Syncsort. If so, could you let me know how to do that?

Thanks,
Bala
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu May 31, 2007 2:31 pm    Post subject:
Reply with quote

Like DFSort, Syncsort can convert characters. Look at the ALTSEQ and the TRAN parameters in your manual.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu May 31, 2007 8:44 pm    Post subject: Re: Is it good to do the above task using SYNCSORT or COBOL
Reply with quote

kbmkris wrote:
Hi,

I am having a file with say n fields of which I have a field with a single alphabetic character.

Bala


Bala,

Please let me know,
1. Is the file FB or VB ?
2. Do you know the position of that single alphabetic character.
3. Character position is static or varies.
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Fri Jun 01, 2007 12:19 pm    Post subject:
Reply with quote

Hey,

With Syncsort use this.


Code:
OPTION COPY                             
ALTSEQ CODE=(D5E8)                 
INREC FIELDS=(1,3,4,1,TRAN=ALTSEQ,5,195)



here input is a 200 byte FB file.
I am changing the value 'N' in position 4 to 'Y'. ( D5 is the Hex code of N and E8 is the hex-code of Y)

If u want more values to be changed, u can give that in the ALTSEQ CODE line seperated by a comma.
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 11:12 am    Post subject: Re: Is it good to do the above task using SYNCSORT or COBOL
Reply with quote

Hi anuj,

I have to do the same thing in a FB file and in a VB file also. Yes, I know the position of the character i want to change and the character will vary.
For e.g.
in my input file, if position 4 is
'C' then i have to change it to '1'.
'A' then to '2'.
'D' then to '3' like that.

Thanks,
Bala
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 1:30 pm    Post subject:
Reply with quote

You can translate more than one character at a time:
ALTSEQ CODE=(F0B7,F1B8,F2B9,F3BA,F4BB,F5BC,F6BD,F7BE,F8BF,F9C0)

Have you checked your manual?
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 2:30 pm    Post subject:
Reply with quote

hi William,

I am not sure how to formulate the corresponding hexcode for the alphabets. Please let me know how to find the corresponding hexcode for alphabets and numbers?

I went on checking with the previous Syncsort related posts in the forum and from that i came to know that some of the commands available in DFSORT will work in SYNCSORT also. I tried and it is working.

The code I used is
Code:
SORT FIELDS=COPY
    INREC IFTHEN=(WHEN=(9,1,CH,EQ,C'C'),OVERLAY=(9:C'1')


All, thanks for your help.

Thanks,
Bala
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 2:39 pm    Post subject:
Reply with quote

How many "IFTHEN" sort of substituions do you have? ONe for every letter in the alphabet? Or just a select few?
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 2:44 pm    Post subject:
Reply with quote

Hi William,

i have to do that based on some condition, say, if my position 7 and 8 of my input file contains TT and the character is C at position 9, i have to replace it to 1. Similarly i have to do for 8 conditions. So i have totally 8 ifthen in my sortcard. The full sortcard i used is
Code:
SORT FIELDS=(1,6,PD,A,7,2,CH,A,9,1,CH,A)               
INREC IFTHEN=(WHEN=(7,2,CH,EQ,C'TT',AND,9,1,CH,EQ,C'C'),
              OVERLAY=(9:C'1')),                       
      IFTHEN=(WHEN=(7,2,CH,EQ,C'TT',AND,9,1,CH,EQ,C'F'),
              OVERLAY=(9:C'2')),                       
      IFTHEN=(WHEN=(7,2,CH,EQ,C'TT',AND,9,1,CH,EQ,C'I'),
              OVERLAY=(9:C'3')),                       
      IFTHEN=(WHEN=(7,2,CH,EQ,C'TT',AND,9,1,CH,EQ,C'M'),
              OVERLAY=(9:C'4')),                       
      IFTHEN=(WHEN=(7,2,CH,EQ,C'TT',AND,9,1,CH,EQ,C'L'),
              OVERLAY=(9:C'5')),                       
      IFTHEN=(WHEN=(7,2,CH,NE,C'TT',AND,9,1,CH,EQ,C' '),
              OVERLAY=(9:C'1')),                       
      IFTHEN=(WHEN=(7,2,CH,NE,C'TT',AND,9,1,CH,EQ,C'M'),
              OVERLAY=(9:C'2')),                       
      IFTHEN=(WHEN=(7,2,CH,NE,C'TT',AND,9,1,CH,EQ,C'L'),
              OVERLAY=(9:C'3'))                         


Thanks,
Bala
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 3:05 pm    Post subject:
Reply with quote

Looks like you got it, what's the problem?
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 4:20 pm    Post subject:
Reply with quote

Hi William,

My input file contains 90000000 records. I want to know what i have to use. I have a COBOL program to do the same without sorted output and this JCL. Which is efficient? Could you please suggest me?

Thanks,
bala
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 4:26 pm    Post subject:
Reply with quote

I'd say, it's pretty much your choice.....
If you already have the COBOL program, why not run both and see which id more efficient?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jun 06, 2007 8:38 pm    Post subject:
Reply with quote

Hi Bala,

Sorry I was away from net for some days, so could not check your reply.

By the way, I hope you got your answer icon_smile.gif .
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Thu Jun 07, 2007 11:45 am    Post subject:
Reply with quote

hi Anuj,

Yes i got that. Thanks for your reply:-)
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jun 07, 2007 7:41 pm    Post subject:
Reply with quote

You are welcome. icon_smile.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am


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