View previous topic :: View next topic
|
Author |
Message |
silan
New User
Joined: 16 Jun 2006 Posts: 8 Location: new delhi
|
|
|
|
Hi,
Here is my requirement:
I want to copy few fields of a ksds and store them at specific places of a sequential file.
This can be done easily in a program ,but i donot want to increase the production inventory for such a simple requirement .
I've very basic knowledge of DFSORT, but i guess this can be done thru DFSORT.
EX:field1 of KSDS to be stored in that field of sequential file that starts
at position 1, having length 3.
field2 of KSDS to be stored in that field of sequential file that starts
at position 8, having length 4.
etc.
-Regards
-Silan |
|
Back to top |
|
|
silan
New User
Joined: 16 Jun 2006 Posts: 8 Location: new delhi
|
|
|
|
Hi members,
yes, i can do like this:
1 .copy the entire ksds thru IDCAMS.
2 .exclude the unwanted fields thru DFSORT.
But again can i do these in a single step thru DFSORT?????
Any possibilities experts!
-regards
-silan mohanty |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Sort can take KSDS files as input.
Sort can include/omit based upon conditions.
Sort can reformat.
Yes, this can be done in a single step. |
|
Back to top |
|
|
silan
New User
Joined: 16 Jun 2006 Posts: 8 Location: new delhi
|
|
|
|
Thanks for confirming!
Will you please give the sysntax.yhat will be really helpful
-rgards
-Silan Mohanty |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi There,
Quote: |
field1 of KSDS to be stored in that field of sequential file that starts
at position 1, having length 3. |
Please give starting position & offset of the field which u want to copy in seq file. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
silan wrote: |
Will you please give the sysntax.yhat will be really helpful |
Go to the "Manuals" link at the top of the page and download a sort manual. |
|
Back to top |
|
|
silan
New User
Joined: 16 Jun 2006 Posts: 8 Location: new delhi
|
|
|
|
Hi Ekta ,
KSDS sequential-file
--------------- ----------------------
<starting-position>,<length> <starting-position>,<length>
---------------------------------- ---------------------------------------
field1-> 1,3 shd be copied to 8,3
field2->9,6 shd be copied to 1,6
......................................................................
......................................................................
like this.
-Thanks
-Silan Mohanty |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
aqilis
New User
Joined: 23 Feb 2007 Posts: 17 Location: NOIDA
|
|
|
|
Hi Frank!,
even i have a similar requirement.I have to extract 3 fields from a KSDS
say the fields are:( The first value indicates starting position and the second field indicates the length)
1,4
8,3
so for each record in the KSDS ,i want to select these two fields only and
place them at the following position of a sequential file- 5,4 and 23,3 respectively.Actually I have to populate the sequential file as per a cobol copybook layout, so the other fields has to be initialized (so as i think).
Please give the syntax.
Thanks |
|
Back to top |
|
|
ibmmainframesyntel
Active User
Joined: 26 Feb 2007 Posts: 126 Location: Chennai
|
|
|
|
silan wrote: |
Hi,
Here is my requirement:
I want to copy few fields of a ksds and store them at specific places of a sequential file.
This can be done easily in a program ,but i donot want to increase the production inventory for such a simple requirement .
I've very basic knowledge of DFSORT, but i guess this can be done thru DFSORT.
EX:field1 of KSDS to be stored in that field of sequential file that starts
at position 1, having length 3.
field2 of KSDS to be stored in that field of sequential file that starts
at position 8, having length 4.
etc.
-Regards
-Silan |
control cards
-------------
INREC=(1,80)....it depends upon ur file length
SORT FIELDS=COPY
OUTREC=(1:1,3,5X,8:4,4)
According to the above control cards
Field1 position in input file is from 1st position
Field2 position in input file is from 4th position
let me knw if u have any QUERY......... |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
silan wrote: |
field1-> 1,3 shd be copied to 8,3
field2->9,6 shd be copied to 1,6 |
Outrec (5:13,6,12:4,3) |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
aqilis wrote: |
1,4
8,3
so for each record in the KSDS ,i want to select these two fields only and
place them at the following position of a sequential file- 5,4 and 23,3 respectively. |
Outrec (9:5,4,27:12,3)
You'll have to specify how you want the rest of the record initialized. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
First off, quit quoting everything from a prior post unless needed, only an idiot would not have the brains to scroll up to see the original post.
ibmmainframesyntel wrote: |
OUTREC=(1:1,3,5X,8:4,4) |
Second off, if you had bothered to read what Frank had written and follow the very concise link, you would know that you need to account for the llbb of variable length files.
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
"mainframe professional" - you have posted control statements with invalid syntax more than once now.
Code: |
INREC=(1,80)....it depends upon ur file length
SORT FIELDS=COPY
OUTREC=(1:1,3,5X,8:4,4)
|
If you had bothered to test this, you would have received syntax errors. And there's no reason to use both the INREC and OUTREC statements here. And you've assumed that the KSDS is fixed-length (which it might be but probably isn't). A KSDS can always be processed as variable-length but cannot always be processed as fixed-length.
Please stop posting untested control statements. And please stop quoting everything. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Silan,
If you want your output file to be VB, you can use this DFSORT job:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (KSDS)
//SORTOUT DD DSN=... output file (VB/14)
//SYSIN DD *
OPTION COPY
RECORD TYPE=V
INREC BUILD=(1,4,5:13,6,12:5,3)
/*
|
If you want your output file to be FB, you can use this DFSORT job:
Code: |
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (KSDS)
//SORTOUT DD DSN=... output file (FB/14)
//SYSIN DD *
OPTION COPY
RECORD TYPE=V
OUTFIL VTOF,OUTREC=(1:13,6,8:5,3)
/*
|
|
|
Back to top |
|
|
|