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 records form GDG to PS file - INCLUDE COND

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

New User


Joined: 20 Dec 2005
Posts: 3

PostPosted: Wed Feb 29, 2012 6:34 pm    Post subject: Copy records form GDG to PS file - INCLUDE COND
Reply with quote

Hi ,
I have GDG with 50k records and want to copy records to PS file from postion 333 upto 12 bytes as below

Code:
//TOOLIN DD *                                   
  COPY FROM(INPUT1) TO(OUTPUT1) USING(CTL1)     
/*                                               
//CTL1CNTL DD   *                               
   INCLUDE COND=(333,12,SS,EQ,C'017137610001',OR,
                               333,12,SS,EQ,C'017127830002',OR,
                               333,12,SS,EQ,C'017137630001',OR,
                               333,12,SS,EQ,C'074135740002')

But is there anyway to change string - C'017137610001' dynamically or generate dynamically INCLUDE COND ..
Regards
TSR
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Wed Feb 29, 2012 6:38 pm    Post subject: Reply to: Copy records form GDG to PS file - INCLUDE COND
Reply with quote

see
http://www.ibmmainframes.com/viewtopic.php?t=57587&highlight=jp1

for the use of the JP1 construct
Back to top
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Wed Feb 29, 2012 9:58 pm    Post subject:
Reply with quote

Using SYMNAMES is an option.

Generate the values as showed below and use them in you include.
The example showed below is to create the SYMNAMES records based on the input and the created value is used in include statement in the next step.

Code:

//SYSIN    DD *                                     
  OPTION COPY,SKIPREC=1,STOPAFT=1                   
  INREC BUILD=(C'KEYVAL,C',C'''',22,15,C'''',80:X) 


Use the generated symbol name in the next step:
Code:

//SYSIN    DD *                                           
  OPTION COPY                                             
  INREC IFTHEN=(WHEN=(1,3,CH,EQ,KEYVAL),OVERLAY=(5:C'DATA INCLUDED'))
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 Mar 01, 2012 12:58 am    Post subject:
Reply with quote

Quote:
But is there anyway to change string - C'017137610001' dynamically or generate dynamically INCLUDE COND.


You need to do a better job of explaining what exactly you want to do. You can certainly generate an INCLUDE statement from values in another file with DFSORT - is that what you want to do? If so, give more details of what the other file looks like (RECFM, LRECL, starting position and length of fields, etc).

If you want to do something else, explain clearly what you want to do. Show examples of input and expected output.
Back to top
View user's profile Send private message
shobanreddy

New User


Joined: 20 Dec 2005
Posts: 3

PostPosted: Sat Mar 03, 2012 9:11 pm    Post subject:
Reply with quote

Thanks for your response.

CARD file - Record format : VB Record length : 133
filed length is 12 bytes and starting at 1st postion as below.
=COLS> ----+----1--
000001 824711900001
000002 017137610001
000003 112689430002
000004 219443680001
000005 116837910003 ...etc

INPUT file - GDG having 50 k records.
Record format: VB ,Recordlength : 32756
OUTPUT file - PS - file attributes is same is out file.

I want to copy records from GDG to PS file which is equal to C'017137610001'... etc fromstarting postion 333 upto 12 bytes length.
So want change the value in the INCLUDE statement - C'017137610001' from run to run.

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Sat Mar 03, 2012 10:43 pm    Post subject: Reply to: Copy records form GDG to PS file - INCLUDE COND
Reply with quote

It does not make any difference to the control cards that one of your input files is a GDG.

Can we assume that the 333 for 12 is in the fixed part of all the records? And it is not overlapping other fields on other record-types which might get a false record?

If the file is already sequenced on 333 for 12, then a JOINKEYS would work well.

If the order of the output file does not matter, a JOINKEYS would again suit.

If you want the output in the same order as the input then generating the INCLUDE cards would be one way.

If you can answer the above, it will help.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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