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 

Create Records based on Count using Syncsort

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


Joined: 20 May 2004
Posts: 97
Topics: 43
Location: hyderabad, India

PostPosted: Sun Apr 02, 2006 1:13 pm    Post subject: Create Records based on Count using Syncsort Reply with quote

Hi ,

I have a input file which is of RECFM=FB & LRECL=85,
The contents of the input file looks like :-
Code:

1-------------------------80----85
XXXXXXXXXXXXXXXXXX          00002
YYYYYYYYYYYYYYYYYYYYY       00001
ZZZZZZZZZZZZZZZZZZ          00003


Requirement is to create a output file of RECFM=FB & LRECL=80 , where the contents of the output file looks like :
Code:

1-------------------------80
XXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXX
YYYYYYYYYYYYYYYYYYYYY
ZZZZZZZZZZZZZZZZZZ
ZZZZZZZZZZZZZZZZZZ
ZZZZZZZZZZZZZZZZZZ

The input file's last 5 bytes contain the count of the occurence of the record to be written in output file.
As record 1 in input file has 2 in its last 5 bytes, thus record #1 of input file must occur twice in output file.

As our shop uses Syncsort , can this problem be solved using Syncsort.

Thanks in advance.
_________________
Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Sun Apr 02, 2006 3:56 pm    Post subject: Reply with quote

pzmohanty,

What is the max count value in pos 81? since it is bytes 99999 is the maximum ?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pzmohanty
Beginner


Joined: 20 May 2004
Posts: 97
Topics: 43
Location: hyderabad, India

PostPosted: Sun Apr 02, 2006 11:55 pm    Post subject: Reply with quote

Hi Kolusu,

Thats right , as you said , the maximum value for the last 5 bytes of input file can be 99999.

Thanks
_________________
Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Apr 03, 2006 4:46 am    Post subject: Reply with quote

pzmohanty,

I don't think it is feasible to achieve the desired results using traditional features of Sort. If your shop has easytrieve then the following JCL will give you the desired results.


Code:
 
//STEP0100 EXEC PGM=EZTPA00                   
//STEPLIB  DD DSN=EASYTREV.LOADLIB, 
//            DISP=SHR                         
//SYSPRINT DD SYSOUT=*                         
//SYSOUT   DD SYSOUT=*                         
//SYSSNAP  DD SYSOUT=*                         
//SYSUDUMP DD SYSOUT=*                         
//INFILE   DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//OUTFILE  DD DSN=YOUR OUTPUT DUPE FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE),
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SYSIN    DD *                   
  FILE INFILE                     
       IN-REC           01 80  A 
       IN-CNT           81 05  N 
                                 
  FILE OUTFILE FB(0 0)           
     OUT-REC             01  80 A
                                 
  W-CNT W 05 N                   
                                 
  JOB INPUT INFILE               
                                 
     W-CNT      = 1       
       
     DO UNTIL W-CNT > IN-CNT     
        OUT-REC = IN-REC         
        PUT OUTFILE               
        W-CNT   = W-CNT + 1       
     END-DO                       
/*


Hope this helps....

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pzmohanty
Beginner


Joined: 20 May 2004
Posts: 97
Topics: 43
Location: hyderabad, India

PostPosted: Mon Apr 03, 2006 1:28 pm    Post subject: Reply with quote

Hi Kolusu,

Thanks a lot for your quick help..
_________________
Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
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