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
 

 

Syncsort - Converting A to 01.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Converting A to 01.
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Syncsort - Converting A to 01.
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

Site Director


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

PostPosted: Fri Nov 21, 2008 8:49 am    Post subject:
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: 2239
Location: @my desk

PostPosted: Fri Nov 21, 2008 11:35 am    Post subject:
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: 2239
Location: @my desk

PostPosted: Fri Nov 21, 2008 11:40 am    Post subject:
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    Post subject: Reply to: Syncsort - Converting A to 01.
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

Site Director


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

PostPosted: Mon Nov 24, 2008 8:55 pm    Post subject:
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    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 Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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