MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to assign values to BI,ZD and PD fields using SORT?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Apr 14, 2006 6:46 am    Post subject: How to assign values to BI,ZD and PD fields using SORT? Reply with quote

Hai All,

I am creating an input dataset with multiple records for a SORT operation and i want to assign

Code:

1.value 2600  to fields 170 - 173 and the field is BI.
2.value 32    to fields 18 - 21   and the field is ZD.
3.value 22530 to fields 22 - 27   and the field is PD.
4.value negative4278 to fields 28 - 33   and the field is PD.


How can i achive that as i want to perfrom SUM operation on those fields and i want to set up my input dataset ?
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Fri Apr 14, 2006 7:55 am    Post subject: Reply with quote

shekar123,

Try this

Code:

//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD *                                 
----+----1----+----2----+----3----+----4----+----
2600     32        22530     -4278               
//SORTOUT  DD DSN=YOUR OUTPUT DSN,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(TRK(1,1),RLSE)
//SYSIN    DD *                                 
 SORT FIELDS=COPY                               
 OUTREC FIELDS=(018:10,2,ZD,EDIT=(TTTT),         
                022:20,5,ZD,PD,LENGTH=6,         
                028:30,5,FS,PD,LENGTH=6,         
                170:01,4,ZD,BI,LENGTH=4)         
/*                                               


Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Apr 14, 2006 10:44 am    Post subject: Reply with quote

It's not clear if you already have the input records and want to overlay these values on them, or if you want to create the records from scratch. Assuming the former, you can use this DFSORT job:

Code:

//S1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=...  input file
//SORTOUT  DD DSN=...  output file
//SYSIN    DD *
  INREC OVERLAY=(170:+2600,TO=BI,LENGTH=4,
      18:+32,TO=ZD,LENGTH=4,
      22:+22530,TO=PD,LENGTH=6,
      28:-4278,TO=PD,LENGTH=6)
  SORT ...
  SUM ...
/*


If you actually want to create the records, please give more details about what exactly you're trying to do and where SUM fits in all this.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Apr 14, 2006 11:49 am    Post subject: Reply with quote

Thanks Kolusu and Frank a lot for your help.

I actually want to create records from the scratch to work on some sample examples with DFSORT.I am refering to the PDF ICE1CG10
Title: z/OS V1R6.0 DFSORT: Getting Started
Document Number: SC26-7527-01

And i am creating the sample datasets
Sample Data Set - SORT.SAMPIN
Sample Data Set - SORT.SAMPADD
Sample Data Set - SORT.BRANCH
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Apr 14, 2006 12:13 pm    Post subject: Reply with quote

Oh, why didn't you says so. You don't need to set up a job to create those data sets. We've already provided a job that sets up those data sets.

See Appendix A of "z/OS DFSORT: Getting Started". It shows you how to execute PGM=ICESAMP to create those data sets. ICESAMP is shipped with DFSORT, so you should be able to use it.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG10/APPENDIX1.1?DT=20050223112358
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Apr 14, 2006 12:55 pm    Post subject: Reply with quote

Thanks a lot for your help Frank , it was simple to create the sample datsets with data in it and can now work and learn DFSORT and ICETOOL.
I was unable to understand that ICESAMP is shipped with DFSORT and the job is so easy.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Apr 14, 2006 1:11 pm    Post subject: Reply with quote

Quote:
I was unable to understand that ICESAMP is shipped with DFSORT and the job is so easy.


Hmmm ... I thought Appendix A was pretty clear about how to use the job shown there. Not sure why you weren't able to understant that. Did you read through Appendix A before you started this thread or did you miss it? If you did read through Appendix A, what made you think you couldn't run the job shown there? Can you suggest anything I can add to Appendix A to make that clearer?
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Apr 14, 2006 2:30 pm    Post subject: Reply with quote

Frank,

Thanks for making me clear in my understanding and it is mistake from my end that i did not go well through the Appendix A.Actually i was unaware of the program PGM=ICESAMP,PARM=(BOOKS) to what actually it is as i had never come across ICESAMP and i did not give a second thought but after your reply i was able to understand.

A suggestion:
A brief description of ICESAMP would be more clear as to what it is actually and how it is related to DFSORT.

I am just a begineer in learning and my apologies if my suggestion is not proper.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Apr 14, 2006 2:36 pm    Post subject: Reply with quote

Quote:
A suggestion:
A brief description of ICESAMP would be more clear as to what it is actually and how it is related to DFSORT.

I am just a begineer in learning and my apologies if my suggestion is not proper.


Ok, I can add something like that. Your suggestion is perfectly proper ... that's exactly what I asked you for.

After 35+ years at IBM, it's can be a bit difficult for me to see through the eyes of a beginner when I'm writing content for the DFSORT books, so it helps to have suggestions from beginners.

Thanks.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group