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 

SYNCSORT - File Processing

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


Joined: 25 Jul 2003
Posts: 15
Topics: 7

PostPosted: Wed Nov 19, 2003 11:25 am    Post subject: SYNCSORT - File Processing Reply with quote

Hello All,

I have a sequential file with 500 variable length records in it.
The layout of the file is as follows:

Field Name Starting Position Length
------------------------------------------------------
OS-FILLER1 01 06
OS-DB-IDENT 07 08
OS-FILLER2 15 21
OS-USERID-IN 36 08
OS-FILLER3 44 03
OS-SSN-IN 47 09
-------------------------------------------------------

Problem statement:
I need to replace the OS-SSN-IN field in every record with OS-USERID-IN for all the records.

Expected result:
Output file with the record structure same as the input file. Only difference would be that for every record the OS-SSN-IN would be replaced by OS-USERID-IN field of that record.

Can I do this using SORT??? If Not, please provide with the sample easytrieve code to achieve the above results.

Needs immediate attention.

Thank You.
Siddharth.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Nov 19, 2003 11:46 am    Post subject: Reply with quote

Siddharth,

The following JCl will give you the desired results.Since your input file is a VB file , you need to add 4 bytes to the start positions of each field to accomodate the RDW.

Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD DSN=YOUR INPUT VB FILE,     
//            DISP=SHR                                 
//SORTOUT  DD DSN=YOUR OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTFIL OUTREC=(1,4,             $ RDW
                 5,46,            $ ALL FIELDS BEFORE SSN-IN
                 51:40,8,         $ REPLACE SSN-IN WITH USER-ID
                 X,               $ SPACE SINCE USER-ID IS ONLY 8 BYTES
                 60)              $ REST OF THE RECORD STARTING FROM 60.
//*


Hope this helps...

cheers

kolusu
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