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 

SORT card for header trailor and detail record count

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


Joined: 08 Jan 2008
Posts: 8
Topics: 3

PostPosted: Thu Aug 11, 2011 3:08 am    Post subject: SORT card for header trailor and detail record count Reply with quote

Hi,
I have one requirement wherina sort cord is required. Details are given belwo, please help me on this.

Inpuit file is like:
HDRabcd
89046gfhgf
89047hfttg
84533nhjhj
TRLhgjf

Ouput expecting in below format:
01abcd - for HDR record
05count - Total number of records including hdr,trl records followed by 'count' string
99 - for TRL record
Back to top
View user's profile Send private message
ta0010274
Beginner


Joined: 08 Jan 2008
Posts: 8
Topics: 3

PostPosted: Thu Aug 11, 2011 4:28 am    Post subject: Reply with quote

I tried with belwo sort card bur result is not coming as desired, pls help me.
Code:
 
  SORT FIELDS=COPY                                             
  OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C'HDR'),  * IF RECORD TYPE = 1
  BUILD=(01:C'HDR',                        * RECORD TYPE         
       04:DATE4,                         * DATE                 
       23:218X))                         * FILLED WITH SPACES   
  OUTFIL REMOVECC,                                             
   TRAILER1=(C'TRL',COUNT=(EDIT=(TTTTTTTT)))
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Thu Aug 11, 2011 5:25 am    Post subject: Reply with quote

It is rather inconsiderate to repeat the request after only an hour and a half or so. . .

People who might have helped often will not. . .

Not to worry, if nothing else, the folks from IBM will be here in a few hours Smile

di
Back to top
View user's profile Send private message
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Thu Aug 11, 2011 6:45 am    Post subject: Reply with quote

ta0010274,
See if below helps...
Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
HDRABCD                                                                 
89046GFHGF                                                             
89047HFTTG                                                             
84533NHJHJ                                                             
TRLHGJF                                                                 
/*                                                                     
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
 OPTION COPY                                                           
 OUTFIL REMOVECC,NODETAIL,HEADER1=('01',4,4,' - FOR HDR RECORD',80:X), 
 TRAILER1=(COUNT=(M11,LENGTH=8),'COUNT',80:X,/,                         
           '99',4,4,' - FOR TRL RECORD',80:X)                           
/*                                                                                                       

OUTPUT
Code:
01ABCD - FOR HDR RECORD
00000005COUNT         
99HGJF - FOR TRL RECORD

Thanks,
Back to top
View user's profile Send private message
ta0010274
Beginner


Joined: 08 Jan 2008
Posts: 8
Topics: 3

PostPosted: Fri Aug 12, 2011 1:31 am    Post subject: Reply with quote

Thanks A lot buddy..it helped me..
Back to top
View user's profile Send private message
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