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
 

 

copy fields of ksds to specific places of a sequential file.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
silan

New User


Joined: 16 Jun 2006
Posts: 8
Location: new delhi

PostPosted: Fri Feb 23, 2007 1:55 pm    Post subject: copy fields of ksds to specific places of a sequential file.
Reply with quote

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
View user's profile Send private message

silan

New User


Joined: 16 Jun 2006
Posts: 8
Location: new delhi

PostPosted: Fri Feb 23, 2007 2:04 pm    Post subject: Re: copy fields of ksds to specific places of a sequential f
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Feb 23, 2007 2:26 pm    Post subject:
Reply with quote

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
View user's profile Send private message
silan

New User


Joined: 16 Jun 2006
Posts: 8
Location: new delhi

PostPosted: Fri Feb 23, 2007 3:17 pm    Post subject: Re: copy fields of ksds to specific places of a sequential f
Reply with quote

Thanks for confirming!

Will you please give the sysntax.yhat will be really helpful

-rgards
-Silan Mohanty
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Feb 23, 2007 3:32 pm    Post subject:
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Feb 23, 2007 3:35 pm    Post subject: Re: copy fields of ksds to specific places of a sequential f
Reply with quote

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
View user's profile Send private message
silan

New User


Joined: 16 Jun 2006
Posts: 8
Location: new delhi

PostPosted: Fri Feb 23, 2007 3:47 pm    Post subject: Re: copy fields of ksds to specific places of a sequential f
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Feb 23, 2007 10:00 pm    Post subject:
Reply with quote

Silan,

Are the records of the KSDS fixed-length (all the same length) or variable-length? How you would do this depends on the answer. See the following for more information:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/1.8.3.4?SHELF=&DT=20060615185603&CASE=
Back to top
View user's profile Send private message
aqilis

New User


Joined: 23 Feb 2007
Posts: 17
Location: NOIDA

PostPosted: Mon Feb 26, 2007 1:01 pm    Post subject: Re: copy fields of ksds to specific places of a sequential f
Reply with quote

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
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Mon Feb 26, 2007 7:34 pm    Post subject: Re: copy fields of ksds to specific places of a sequential f
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Feb 26, 2007 8:07 pm    Post subject: Re: copy fields of ksds to specific places of a sequential f
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Feb 26, 2007 8:11 pm    Post subject: Re: copy fields of ksds to specific places of a sequential f
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Feb 26, 2007 8:20 pm    Post subject:
Reply with quote

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.
Frank Yaeger wrote:
Are the records of the KSDS fixed-length (all the same length) or variable-length? How you would do this depends on the answer. See the following for more information:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/1.8.3.4?SHELF=&DT=20060615185603&CASE=
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 Feb 26, 2007 9:47 pm    Post subject:
Reply with quote

"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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Feb 26, 2007 10:08 pm    Post subject:
Reply with quote

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
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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