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

Syncsort - Converting A to 01.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Nov 20, 2008 7:10 pm
Reply with quote

Hi,

I have an input file with LRECL (267) and RECFM (FB). I am using .... here NOT to show remaining data.

Input Data:
Code:

----+----1----+----2----+
199200 00A009 .......................................................................
199200 00A009 .......................................................................
192200 00B008 .......................................................................


Expected Output Data:
Code:

199200 0001009
199200 0001009
192200 0002009


Whenever a 'A' is found at 10th position it should be replaced with '01' and if 'B' found should be replaced with '02' and so on....

Is using INREC with IFTHEN WHEN the only way with Syncsort or any simpler version possible? I say simpler version because it should be easy to understand and fix if a production abend occurs !

Please help.

Thanks.
Back to top
View user's profile Send private message
darkstar13

New User


Joined: 06 Nov 2008
Posts: 46
Location: Manila, Philippines

PostPosted: Fri Nov 21, 2008 3:56 am
Reply with quote

I think using INREC IFTHEN=(WHEN... ) command is a simple conditional statement and is already easy to understand.

However, what I don't understand is your input record. I think it should be like:
Code:
----+----+----+
199200 00A009
199200 00B009
199200 00C009


and you want to have
Code:

----+----+----+
199200 0001009
199200 0002009
199200 0003009


am I right? If so, then your outpur LRECL will be 268, and that records 11 to 267 will be moved to the right by 1?
Back to top
View user's profile Send private message
darkstar13

New User


Joined: 06 Nov 2008
Posts: 46
Location: Manila, Philippines

PostPosted: Fri Nov 21, 2008 3:59 am
Reply with quote

My mistake, your input looks ok, my screen was just not maximized. Sorry for that..

Anyway, will your expected output LRECL be 268? or the last byte be truncated?
Back to top
View user's profile Send private message
darkstar13

New User


Joined: 06 Nov 2008
Posts: 46
Location: Manila, Philippines

PostPosted: Fri Nov 21, 2008 4:15 am
Reply with quote

If you really dont want IFTHEN, you can use ALTSEQ:

Code:
OPTION COPY
ALTSEQ CODE=(C1F1,
             C2F2,
             C3F3,
             C4F4)


Or something like that. (That logic replaces A by 1. But you can manipulate things to fit your requirement.)
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Nov 21, 2008 8:40 am
Reply with quote

Hi, ET.

The output LRECL should accommodate the expanded byte also. The records always don't appear in the same incremental form. We don't receive the file in SORTed format neither we send it out to lower systems in SORTed format.

So, I am confused how to achieve it.

Thanks.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Nov 21, 2008 8:49 am
Reply with quote

Hello,

Quote:
The output LRECL should accommodate the expanded byte also.
Does this mean the output lrecl will be one byte longer?

Quote:
The records always don't appear in the same incremental form.
What does this mean? Show examples of this.

Quote:
We don't receive the file in SORTed format neither we send it out to lower systems in SORTed format.
How does thi relate to converting the 1-position "letters" to 2-position numbers. You say "and so on" - until when?

Once you provide a better explanation of what you need to do, someone will be able to offer better suggestions.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Nov 21, 2008 11:35 am
Reply with quote

Ramsri,

ALTSEQ does n't require this to be sorted in any form. The below job might help.
Code:
//STEP01  EXEC PGM=SORT                       
//SYSOUT    DD SYSOUT=*                       
//SORTOUT   DD SYSOUT=*                       
//SORTIN    DD *                             
----+----1----+----2----+----3----+----4----+-
199200 00C009                                 
199200 00A009                                 
192200 00B008                                 
199200 00A009                                 
//SYSIN     DD *                             
 OPTION COPY                                 
 ALTSEQ CODE=(C1F1,C2F2,C3F3)                 
 INREC FIELDS=(1,9,C'0',10,1,TRAN=ALTSEQ,11,3)
SORTOUT
Code:
----+----1----+
199200 0003009
199200 0001009
192200 0002008
199200 0001009
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Nov 21, 2008 11:40 am
Reply with quote

Ramsri,

The above job is limited to convert A-I to 1-9, but if you have alphabets beyond that, I would suggest using IFTHEN, which is easy to understand and more flexible.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Nov 24, 2008 6:06 pm
Reply with quote

arcvns,

Thank you.

I would like to know how it takes care of adding extra byte to accommodate new LRECL. We actually use 14 values for conversion (including the obsolete ones). If I remove those obsolete entries then it comes around 9 to 10 values to be converted.

Is it the limitation of SORT that it does convert only A to I?

Thanks.[/code]
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Nov 24, 2008 8:55 pm
Reply with quote

Hello,

Quote:
Is it the limitation of SORT that it does convert only A to I?
No, the limit is what you code in the ALTSEQ conversion list.

Quote:
I would like to know how it takes care of adding extra byte to accommodate new LRECL.
In the example posted it doesn't. The input and the output are both lrecl 80. You would need to code proper jcl for the new lrecl.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Converting fixed length file to excel... IBM Tools 7
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
Search our Forums:

Back to Top