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
 

 

Extract only those records whose RECORD-ID in Syncsort

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

New User


Joined: 15 Feb 2006
Posts: 18

PostPosted: Fri Jul 06, 2007 8:20 am    Post subject: Extract only those records whose RECORD-ID in Syncsort
Reply with quote

Following is my requirement,

I have input file say of record length 200 fixed length and the records are in the following format,

ORG PIC 9(03)
ACCOUNT NUMBER PIC X(19)
RECORD-ID PIC X(2)
NAME PIC (30)
ADDRESS PIC X(40)
PHONE PIC 9(15)
CUSTOMER NUMBER PIC 9(19)
FILLER PIC X(73)


The output file should of record length 45(Fixed format) with the following record layout :

01 or 02 (depending on value of RECORD-ID need to be inserted at first 2 postions)

ORG

ACCOUNT NUMBER

RECORD-ID

CUSTOMER NUMBER



Following is the output file requirement

1. I want to extract only those records whose RECORD-ID is either BS or NA

2. I want to take only values of ORG, ACCOUNT NUMBER, RECORD-ID and CUSTOMER NUMBER from the input file

3. If RECORD-ID is BS insert 01 at first 2 positions, if it is NA, insert 02 at first 2 positions

4. Thus the total length of output file is 45

Can someone please tell me how to achieve this. My shop has Syncsort utility.

Thanks and Regards
Rajiv Garg
Back to top
View user's profile Send private message

a027412

New User


Joined: 05 Jul 2007
Posts: 40
Location: Minneapolis, MN

PostPosted: Fri Jul 06, 2007 10:09 am    Post subject: If you need in DFSORT, here goes the code
Reply with quote

Code:

//STEP01  EXEC  SORT                                   
//SORTIN   DD  DSN=InputDataSet,             
//             DISP=SHR                                   
//SORTOUT  DD  DSN=OutputDataSet,                   
//             DISP=(NEW,CATLG,DELETE),                   
//             UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),     
//             DCB=(LRECL=45,RECFM=FB,BLKSIZE=0)         
//SYSIN  DD  *                                           
 INCLUDE COND=(23,2,CH,EQ,C'BS',OR,23,2,CH,EQ,C'NA')     
 OUTREC FIELDS=(1:23,2,CHANGE=(2,C'BS',C'01',C'NA',C'02'),
                  3:1,24,                                 
                  27:110,19)                             
 SORT FIELDS=COPY                                         
/*                                                       
Back to top
View user's profile Send private message
rgarg

New User


Joined: 15 Feb 2006
Posts: 18

PostPosted: Sat Jul 07, 2007 6:20 am    Post subject: Re: Extract only those records whose RECORD-ID in Syncsort
Reply with quote

The Code works. Thanks you so much for the help. But i can't able to get the sort card here i.e. Can you please explain me this sort card?
Back to top
View user's profile Send private message
a027412

New User


Joined: 05 Jul 2007
Posts: 40
Location: Minneapolis, MN

PostPosted: Sat Jul 07, 2007 2:00 pm    Post subject:
Reply with quote

the INCLUDE COND, picks only the input record containing BS or NA at the position 23 to 24

In the OUTREC,
Output position 1, pick characters from 23 to 24 from the input record and change the character BS to 01 or NA to 02
Output position 3, pick characters from 1 to 24 from the input record
Output position 27, pick characters from 110 to 129 from the input record
Back to top
View user's profile Send private message
rgarg

New User


Joined: 15 Feb 2006
Posts: 18

PostPosted: Sat Jul 07, 2007 6:01 pm    Post subject: Thank you very much for the help
Reply with quote

Thanks for making me understand. Thank you very much for the help icon_smile.gif
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 Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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