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
 

 

Copying records using INCLUDE

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

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Mon Apr 16, 2012 2:49 pm    Post subject: Copying records using INCLUDE
Reply with quote

I am trying to copy records having a field in S9(12) format.


Code:


FIELD NAME ---------- -                   PICTURE- - START     END  LENGTH
FIELDA                                   S9(12)       5197      5203       7


I am using condition as
Code:

SORT FIELDS=COPY                                         
     INCLUDE COND=(5100,100,SS,EQ,X'369395124501')       



But its not picking the record. Not sure what mistake I am doing.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Apr 16, 2012 2:58 pm    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

well...
what does Your record look like when You browse it and display it in hex format ?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Mon Apr 16, 2012 3:06 pm    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

You don't have a field in an S9(12) format. What you have quoted only shows you the number of decimal digits the field will be allowed to hold (nb, depends on compiler option for a binary field).

So, you have a signed numeric field. It is either Zoned Decimal, Packed Decimal or Binary. A Zoned Decimal would be 12 bytes, a binary would be a double-word (eight bytes) and your display shows a length of seven. The length of S9(12) comp-3 (packed-decimal) would be seven bytes.

X'0369395124501C'

That is what a value of 369395124501 would look like if positive in a packed-decimal field. If negative the C would be a D. If your data may not conform to picture, then A through F would be valid for the final character in the hex string above?

Why don't you know the position? Are you searching for a value in an OCCURS?
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Mon Apr 16, 2012 3:08 pm    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

Record look like this.


Code:


7/PS         
(5197-5203) 
375----------
*************
     &       
0635251     
399140C     

Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Mon Apr 16, 2012 3:11 pm    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

So that's why you couldn't find it. SS can't do "half-bytes" which is effectively what you tried (two of them).

Try with the string I suggested above.
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Mon Apr 16, 2012 3:27 pm    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

I tried


Code:

INCLUDE COND=(5197,7,PD,EQ,X'0369395124501C')



But still its nt getting copied
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Apr 16, 2012 3:32 pm    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

if the record is variable remember to take into account the 4 bytes RDW
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Mon Apr 16, 2012 3:37 pm    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

Plus, if you're going to look in a specific position, for a PD, why don't you just put +369395124501? No need to do it as X'...'
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Mon Apr 16, 2012 9:48 pm    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

Still not working.
And input file format is FB.
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 Apr 16, 2012 10:24 pm    Post subject:
Reply with quote

Hello,

Quote:
Still not working.
Probably you have specified the wrong displacement/length or have specified a non-matching value. Only you can verify that your specifications are correct.

Suggest you post the complete JCL and sort control info as well as the informational messages (including the message ids) generated by the run.
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Mon Apr 16, 2012 10:25 pm    Post subject:
Reply with quote

Code:
INCLUDE COND=(5197,7,PD,EQ,369395124501)


Try it.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Mon Apr 16, 2012 11:49 pm    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

Code:
//INCPD    EXEC PGM=SORT
//SORTIN DD *
369395124501
//SYSOUT   DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTOFF1 DD SYSOUT=*
//SORTOFF2 DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  INREC  OVERLAY=(15:1,12,ZD,TO=PD,LENGTH=7,
                  25:15,7,PD,TO=ZD,LENGTH=12)
  OUTFIL INCLUDE=(15,7,PD,EQ,+369395124501)
  OUTFIL FILES=F1,INCLUDE=(15,7,PD,EQ,369395124501)
  OUTFIL FILES=F2,INCLUDE=(15,7,CH,EQ,X'0369395124501C')


All three OUTFILs give the following:

Code:
369395124501       &    369395124501


When I use your PD with comparison to X'...' it gives a syntax error. That would explain why that one isn't working, it's an

Code:
ICE114A E INVALID COMPARISON


If you didn't notice that one, have you got other errors in your sort deck which are preventing the correct results appearing in the output?
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Tue Apr 17, 2012 8:51 am    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

Thanks a lot. Condition works. I haves used below condition finaly.

Code:

  OPTION COPY                                         
  OUTFIL INCLUDE=(5197,7,PD,EQ,+369395124501)         


I am using two files in SORTIN, is there a way to find out from which file this record gets selected and on finding that copy first and last record present in that file.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Tue Apr 17, 2012 11:58 am    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

You've not mentioned that bit before.

You cannot tell directly from which of concatenated files a particular record came from.

If you can set out this new requirement clearly, someone may be able to help.

What if the data appears on both files? Neither file? Is duplicate on a file?

Is there anything on the records to distinguish which file it comes from?

Is there any "count" of the records on a trailer for the files, for instance?

What are the "first" and "last" record that you want?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Apr 17, 2012 12:44 pm    Post subject: Reply to: Copying records using INCLUDE
Reply with quote

it would be nice, and would save everybody a lot of time,
if the requirements were all described in the initial question !
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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 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
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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