|
View previous topic :: View next topic
|
| Author |
Message |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
Hi All,
I have a query. Below are details
I have got an input file (VB format) of record length 1352. Below is the sample record from the file.
TC139002344528 .°..°...................552
From the above record i need to convert value 552 (starting position 53, lenght 3) to packed decimal (PD), based on the sort key value C13900 (starting position 2,length 6)
Note that all other records not matching key i need to directly write to output file with out doing any conversion,
Let me know if its doable. Tips are welcome |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
sumueng,
Since your input is a vb file , you need to account for 4 bytes of RDW. Use the following DFSORT control cards
| Code: |
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(6,6,CH,EQ,C'C13900'),
OVERLAY=(57:57,3,ZD,PD,LENGTH=3))
/* |
|
|
| Back to top |
|
 |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
| Thanks for the tip. I will try it out and let know |
|
| Back to top |
|
 |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
Let me know, is it possible to include one more check inside WHEN condition like below
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=((6,6,CH,EQ,C'C13900') AND (17,2,CH,NE,C' '))
OVERLAY=(57:57,4,PD,ZD,LENGTH=4))
When i tried using two different checks i am getting error.
I require mulitple field checks using the above the IF condition. Is it doable |
|
| Back to top |
|
 |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
Hi
I need to change the PD (Packed decimal) values lying in Position 53 and length 3 (since the file is in VB format 53 turns to 57 for RDW) to integer format, using the below sort card i am not getting proper output
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(6,6,CH,EQ,C'C13900'),
OVERLAY=(57:57,3,ZD,PD,LENGTH=3))
/*
Output:
TC139002344528 .°..°...................55B.
The value requied in the output is 552, but it is showing 55B.
Let me know |
|
| Back to top |
|
 |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
Sorry
the sort card provide in the above post is wrong,
Below is sort card i used to convert packed decimal to Integer format
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(6,6,CH,EQ,C'C13900'),
OVERLAY=(57:57,3,PD,ZD,LENGTH=3))
The packed decimal starting positon in 53 and lenght 3 (as the file is in VB format 53 turn to 57)
After changing using the above sort the Packed value has now changed to 55B. The required output should be 552.
Let me know |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| After changing using the above sort the Packed value has now changed to 55B. The required output should be 552. |
That means you're using Syncsort, not DFSORT. DFSORT would give you 552.
Since this is a Syncsort question, I'm moving it to the JCL Forum.
|
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
| sumueng wrote: |
| Code: |
| OVERLAY=(57:57,3,PD,ZD,LENGTH=3)) |
After changing using the above sort the Packed value has now changed to 55B. The required output should be 552.
|
Which release of SyncSort for z/OS are you running? |
|
| Back to top |
|
 |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
I am usiing below Syncsort release
SYNCSORT FOR Z/OS 1.3.1.0 |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
sumueng,
Change ZD to ZDF |
|
| Back to top |
|
 |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
Thanks for Tip boss. It worked well
Now i would like to know is it possible to add another field check using below when condition.
I tried using below way, but received error. let me know
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(6,6,CH,EQ,C'C13900' AND '17,2,CH,NE,C' '),
OVERLAY=(57:57,3,PD,ZDF,LENGTH=3)) |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| Quote: |
| but received error |
This leaves nothing but guesses. Can you post the SYSOUT messages here. |
|
| Back to top |
|
 |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
When used the following Sort got syntax error with below sysout message
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(6,6,CH,EQ,C'C13900' AND '17,2,CH,NE,C' '),
OVERLAY=(57:57,3,PD,ZDF,LENGTH=3))
Sysout message:
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 16595, MODEL 2094 506
SYSIN :
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(6,6,CH,EQ,C'C13900' AND '17,2,CH,NE,C' '),
*
OVERLAY=(57:57,3,PD,ZDF,LENGTH=3))
*
WER268A INREC STATEMENT : SYNTAX ERROR
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| You MISS a comma (,) before and after the AND keyword and make sure your your control statements start only after the 1st column. |
|
| Back to top |
|
 |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
I am still getting syntax error after inserting comma (,) before and after AND
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 16595, MODEL 2094 506
SYSIN :
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(6,6,CH,EQ,C'C13900',AND,'17,2,CH,NE,C' '),
*
OVERLAY=(57:57,3,PD,ZDF,LENGTH=3))
*
WER268A INREC STATEMENT : SYNTAX ERROR
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Btw which control statements are you refferring boss. i got little confused with your statment. |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| Quote: |
| Btw which control statements are you refferring boss. i got little confused with your statment |
Boss,
The statements which you pass to SyncSort using SYSIN DD * or SYSIN DD DSN= are called control statements. They should start only after pos-1. |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
| sumueng wrote: |
| Code: |
INREC IFTHEN=(WHEN=(6,6,CH,EQ,C'C13900',AND,'17,2,CH,NE,C' '),
WER268A INREC STATEMENT : SYNTAX ERROR
|
|
You have an extra quote (') after the AND operand. Try this:
| Code: |
| INREC IFTHEN=(WHEN=(6,6,CH,EQ,C'C13900',AND,17,2,CH,NE,C' '), |
|
|
| Back to top |
|
 |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
| Thanks for the tips. It worked fine now |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|