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
 

 

How to avoid typing the key field repeatedly in include cond
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Arun Kumar Tupili

New User


Joined: 30 Nov 2006
Posts: 14
Location: Banglore

PostPosted: Fri Aug 31, 2007 3:57 pm    Post subject: How to avoid typing the key field repeatedly in include cond
Reply with quote

Hi,
I just want to sort the file based on a key value which is of length 50 bytes(same character repeating for 50 times).

I know the cond INCLUDE COND=(1,5,CH,EQ,C'AAAAAA')

I dont want to type the character 50 times in include condition.

can any one pls suggest me a short cut which avoids me in typing the same character in include 50 times.

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

SCANDY

New User


Joined: 08 Aug 2007
Posts: 10
Location: Dalian, China

PostPosted: Fri Aug 31, 2007 4:09 pm    Post subject:
Reply with quote

How about this:
Code:
INCLUDE COND=(1,5,CH,EQ,50C'A')

Words from getting started:
The format for repeating a character string is:
nC’x...x’
where n can be from 1 to 4095; n repetitions of the character string (C'x...x') are inserted into the reformatted records. If n is omitted, 1 is used instead.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Aug 31, 2007 4:17 pm    Post subject:
Reply with quote

Arun Kumar Tupili

If you want to sort the file by key, then you do not need to know the key values, only the location and length.

For a straight sort you do not need INCLUDE statements.

Code:

  SORT  FIELDS=(start,length,A or D),FORMAT=data format


As for typing one character 50 times .... Is this SO strenuous icon_confused.gif
Back to top
View user's profile Send private message
Arun Kumar Tupili

New User


Joined: 30 Nov 2006
Posts: 14
Location: Banglore

PostPosted: Fri Aug 31, 2007 4:25 pm    Post subject: Reply to: How to avoid typing the key field repeatedly in in
Reply with quote

Hi Scandy,

I am getting MAXCC=16, comparision field error. please see the error below.

Code:
            SORT FIELDS=COPY                       
            INCLUDE COND=(11,02,EQ,2C'S')           
                                    $               
ICE113A E COMPARISON FIELD ERROR                 



Thanks
Arun
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Aug 31, 2007 4:27 pm    Post subject:
Reply with quote

Quote:
As for typing one character 50 times .... Is this SO strenuous icon_confused.gif
...snort....giggle....
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Aug 31, 2007 4:44 pm    Post subject:
Reply with quote

Arun Kumar Tupili

Can we clarify exactly what it is you want to do. You started by saying that you wanted to sort the file, and now we see that you actually appear to want to select certain records using the COPY option.

Also could you clarify which sort product you are using as the statments wmay vary between the two main products.

Also post your error messages and output to get faster assitance.

Initial guess

INCLUDE COND=(11,02,EQ,2C'S')

SHOULD BE

INCLUDE COND=(11,02,CH,EQ,2C'S')
Back to top
View user's profile Send private message
SCANDY

New User


Joined: 08 Aug 2007
Posts: 10
Location: Dalian, China

PostPosted: Fri Aug 31, 2007 5:37 pm    Post subject:
Reply with quote

Just as expat's suggestion,

Here is the link Frank has recommended before:
http://www-03.ibm.com/servers/eserver/zseries/zos/bkserv/lookat/
you should use it often. You can check more detail description about error you occured via MessageID, like "ICE113A" in
Code:
SORT FIELDS=COPY                       
            INCLUDE COND=(11,02,EQ,2C'S')           
                                    $               
ICE113A E COMPARISON FIELD ERROR                 
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Aug 31, 2007 9:26 pm    Post subject:
Reply with quote

.rant on

Arrghhh!!! SCANDY and others - Would you people please stop giving lousy advice as if you know what you're talking about!

Quote:
How about this:

INCLUDE COND=(1,5,CH,EQ,50C'A')

Words from getting started:
The format for repeating a character string is:
nC’x...x’
where n can be from 1 to 4095; n repetitions of the character string (C'x...x') are inserted into the reformatted records. If n is omitted, 1 is used instead.


You're quoting from the syntax for OUTREC, not INCLUDE. OUTREC allows nC'x...x' - INCLUDE doesn't.

I'm getting really tired of correcting the misinformation constantly given by some people in this forum. My timezone means everyone gets to respond before I do and then I have to clean up the mess. Cut it out. If you can't test a "solution", then please don't post it. If you don't have time to look things up in the DFSORT book to make sure you know what you're talking about, then please don't post. I really don't have time to correct all of this stuff. If you're not absolutely sure you have the correct solution to a DFSORT or ICETOOL question, please just let me answer it - it will save everybody time.

.rant off

Now getting back to the original post - Arun - it isn't clear what you're trying to do - please clarify what you want. Are you trying to INCLUDE records where the 50 byte field is all 'A's or are you trying to do something else? Is there more than one constant? Do you have the constants in a file somewhere? Please give more details.
Back to top
View user's profile Send private message
Arun Kumar Tupili

New User


Joined: 30 Nov 2006
Posts: 14
Location: Banglore

PostPosted: Mon Sep 03, 2007 11:28 am    Post subject: Reply to: How to avoid typing the key field repeatedly in in
Reply with quote

Hi Frank Yaeger,

I am sorry for mentioning Sort. I want to Include the records in a file based on a key value which is of length 50 bytes(same character repeating for 50 times).

For Example
QW AAAAA 1234 Steeet1
WE AAAAA 1123 Street2

We can use the INCLUDE COND=(4,5,CH,EQ,C'AAAAA')
It is okay if the number of characters in the keyfiled are less.

But if the same char is repeating in the key field for 50+ times as shown below
ZX AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.... 2341 Street2, its difficult for typing INCLUDE COND=(4,5,CH,EQ,C'AAAAA.......').

Isn't there any other way of reducing in typing the same char in include condition.


Thanks in Advance
Arun
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Mon Sep 03, 2007 12:16 pm    Post subject:
Reply with quote

Arun Kumar Tupili,

Character "*" in the position 72 play as a continuation of next line for sort cards.
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 INCLUDE COND=(4,50,CH,EQ,C'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA*
 AAAAAAA')
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Mon Sep 03, 2007 12:38 pm    Post subject:
Reply with quote

Arun Kumar Tupili,

Please continue the next line on 16th column if "*" is used as a continuation in position 72.
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 INCLUDE COND=(1,50,CH,EQ,C'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA*
               AAAAAAA')                                               
Back to top
View user's profile Send private message
Arun Kumar Tupili

New User


Joined: 30 Nov 2006
Posts: 14
Location: Banglore

PostPosted: Mon Sep 03, 2007 2:20 pm    Post subject: Reply to: How to avoid typing the key field repeatedly in in
Reply with quote

Hi,

What I meant was, typing 50 times woudn't be feasible. What if the character appears in the keyfiled for 1500 times. In that senario, typing the same character 1500 times is hectic.

I just want to know if there is any shortcut to avoid in repeated typing of the same char in Include Cond.

Thanks
Arun
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Sep 03, 2007 9:41 pm    Post subject:
Reply with quote

There's no direct shortcut. You could generate the constant as a symbol and then use that symbol. For example, for 50 A's, you could generate a DFSORT symbol and use it like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(C'C1,''',50C'A',C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...   output file
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(4,50,CH,EQ,C1)
/*


However, that method will only work for a maximum constant of 50 bytes (the limit for a Symbol constant).

Generating the actual control statement rather than just the symbol would allow you to use a larger constant. But the maximum length for an INCLUDE constant is 256 bytes so your example of repeating a character 1500 times would be invalid.
Back to top
View user's profile Send private message
Arun Kumar Tupili

New User


Joined: 30 Nov 2006
Posts: 14
Location: Banglore

PostPosted: Wed Sep 05, 2007 2:20 pm    Post subject:
Reply with quote

Hi Frank

Thanks for the solution. It worked icon_smile.gif .
Could you please clarify the syntax for
INREC BUILD=(C'C1,''',50C'A',C'''',80:X) .
Why are there 3 single quotes after C1 and 4 quotes after 50C'A'. What do they represent .
To represent a character string constant (say O'Neil ) we can write as
C1,C'O''Neil' . But we weren't able to make out the same from 50C'A' as mentioned by you in INREC bUILD above.
Is it that 80th col should always have a space ?
Can we include the rest of the fields from i/p file in the INREC BUILD .
If you could throw more light on this it"ll help us a lot.


Thanks
Arun
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Sep 05, 2007 7:15 pm    Post subject:
Reply with quote

As single quote are used for enclosing some data in sort cards such as C'xxxxx',X'xxxxx',....,it's not possible to print the single quote in output directly by coding as single quotes itself. So they designed a architecture such that two single quotes will print a single "single quote" in output.

If you want to print ' in output, code as ''
If you want to print '' in output, code as ''''
If you want to print ''' in output, code as ''''''
If you want to print '''' in output, code as ''''''''
.
.
.
.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Sep 05, 2007 9:32 pm    Post subject:
Reply with quote

Quote:
Could you please clarify the syntax for
INREC BUILD=(C'C1,''',50C'A',C'''',80:X) .
Why are there 3 single quotes after C1 and 4 quotes after 50C'A'. What do they represent .


When using C'string' you need two apostrophes for each apostrophe in the string.

C'C1,''' = C1,'
50C'A' = A...A
C'''' = '

So the string is C1,'A...A' - this creates a symbol named C1 for A...A (50 A's).

Quote:
Is it that 80th col should always have a space ?


Symbol statements must be 80 bytes long so we use 80:X to make the records 80 bytes long.

Quote:
Can we include the rest of the fields from i/p file in the INREC BUILD.


I don't understand your question. In S1, we're building a symbol named C1. In S2, we're using C1 in an INCLUDE statement. S1 does not use the input file - it just uses a SYSIN record. S2 uses the input file. I don't know where you want to "include the rest of the fields from the i/p file". You need to explain what that means and what you want to do that requires it.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Sep 05, 2007 9:38 pm    Post subject:
Reply with quote

Quote:
If you want to print ' in output, code as ''
If you want to print '' in output, code as ''''
If you want to print ''' in output, code as ''''''
If you want to print '''' in output, code as ''''''''


Actually, that should be:

If you want to print ' in output, code as C''''
If you want to print '' in output, code as C''''''
If you want to print ''' in output, code as C''''''''
If you want to print '''' in output, code as C''''''''''
Back to top
View user's profile Send private message
Arun Kumar Tupili

New User


Joined: 30 Nov 2006
Posts: 14
Location: Banglore

PostPosted: Thu Sep 06, 2007 9:35 am    Post subject:
Reply with quote

Hi Frank
Thanks for the explanation.

I have a doubt on SYMNAMES . Can SYMNAMES be used instead of INREC BUILD=(C'C1,''',50C'A',C'''',80:X) i.e. can the symbol C1 used here be generated using SYMNAMES ? If so what should be the syntax .
In SYMNAMES we can write C1 as
C1,C'AAAA.......AAA' i.e. (A 50 times in quotes). How to avoid typing A 50 times with SYMNAMES. Is it possible using SYMNAMES ?

I had asked if we can include the fileds from i/p file using INREC BUILD . It's just a query on the INREC BUILD statement only.
Back to top
View user's profile Send private message
Arun Kumar Tupili

New User


Joined: 30 Nov 2006
Posts: 14
Location: Banglore

PostPosted: Thu Sep 06, 2007 9:41 am    Post subject:
Reply with quote

Frank

Could you explain the following syntax .

//SORTIN DD *
RECORD

What's it's use and what does this RECORD statement do ?


Thanks
Arun
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Sep 06, 2007 9:27 pm    Post subject:
Reply with quote

Quote:
How to avoid typing A 50 times with SYMNAMES. Is it possible using SYMNAMES ?


You seem to be missing the whole point of the solution. It does let you avoid typing A 50 times by using 50C'A' instead. When you look at my solution, do you see 50 A's typed anywhere? No, you don't. You see 50C'A'.

Step S1 creates one Symbol record in SORTOUT (&&S1). SORTIN has one record for input to give one record for output. The INREC converts the one "dummy" input record (it could be anything including all blanks) to an 80-byte output record in SORTOUT with a Symbol statement containing 50 A's like this:

Code:

C1,'A....A'


That's the Symbol statement you need for your 50 A's, but you didn't have to type all the A's since you used 50C'A' instead. The Symbol statement equates C1 to a constant of 50A's. You then use that SORTOUT data set (&&S1) as the SYMNAMES input for step S2 allowing you to use the C1 symbol in the INCLUDE statement of step S2:

Code:

  INCLUDE COND=(4,50,CH,EQ,C1)


So:

Step S1 creates the Symbol statement in &&S1 which equates C1 to a constant of 50 A's.

Step S2 uses &&S1 as SYMNAMES. C1 is then available for the INCLUDE statement.

Is it clear now?
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 22 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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