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
 

 

Query related to writing trailer record

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

New User


Joined: 24 Mar 2008
Posts: 8
Location: Bangalore

PostPosted: Thu Aug 07, 2008 12:26 pm    Post subject: Query related to writing trailer record
Reply with quote

Hi,
I have an input file with different record types like 010,020 till 070.

Position : 1
Size : 3
Type: ZD


My output file should have the input records as well as a trailer.
The trailer must be like:

1-87 pos: fileld with 9's

88-90 : Count of 010
91:93 : Count of 020
....
...
106-108: Count of 070
109-500: Spaces


can any one help me with it.

Bye,
Dev
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: Fri Aug 08, 2008 2:07 am    Post subject:
Reply with quote

Do your input records have just the type number or do they have other data?

What is the RECFM and LRECL of your input file?

What do you want for the RECFM and LRECL of your output file?
Back to top
View user's profile Send private message
devagarwal

New User


Joined: 24 Mar 2008
Posts: 8
Location: Bangalore

PostPosted: Fri Aug 08, 2008 9:33 am    Post subject: Reply to: Query related to writing trailer record
Reply with quote

Hi,
The input file has other contents also apart from the record type.
LRECL = 500, RECFM=FB

Output file:
LRECL = 500, RECFM=FB

With Regards,
Dev
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: Fri Aug 08, 2008 11:22 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (FB/500)
//SORTOUT DD DSN=... output file (FB/500)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(501:7C'000')),
    IFTHEN=(WHEN=(1,3,ZD,EQ,10),OVERLAY=(501:C'001')),
    IFTHEN=(WHEN=(1,3,ZD,EQ,20),OVERLAY=(504:C'001')),
    IFTHEN=(WHEN=(1,3,ZD,EQ,30),OVERLAY=(507:C'001')),
    IFTHEN=(WHEN=(1,3,ZD,EQ,40),OVERLAY=(510:C'001')),
    IFTHEN=(WHEN=(1,3,ZD,EQ,50),OVERLAY=(513:C'001')),
    IFTHEN=(WHEN=(1,3,ZD,EQ,60),OVERLAY=(516:C'001')),
    IFTHEN=(WHEN=(1,3,ZD,EQ,70),OVERLAY=(519:C'001'))
  OUTFIL REMOVECC,
    BUILD=(1,500),
    TRAILER1=(87C'9',
      88:TOT=(501,3,ZD,TO=ZD,LENGTH=3),
      91:TOT=(504,3,ZD,TO=ZD,LENGTH=3),
      94:TOT=(507,3,ZD,TO=ZD,LENGTH=3),
      97:TOT=(510,3,ZD,TO=ZD,LENGTH=3),
     100:TOT=(513,3,ZD,TO=ZD,LENGTH=3),
     103:TOT=(516,3,ZD,TO=ZD,LENGTH=3),
     106:TOT=(519,3,ZD,TO=ZD,LENGTH=3))
/*
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Aug 09, 2008 12:41 am    Post subject:
Reply with quote

frank,

that is a keeper.
little utility like that is easy and quick in REXX, but would be a pain to train someone without REXX background.
The DFSORT solutions are something that can be handed off easily.
Back to top
View user's profile Send private message
devagarwal

New User


Joined: 24 Mar 2008
Posts: 8
Location: Bangalore

PostPosted: Mon Aug 11, 2008 1:15 pm    Post subject: Reply to: Query related to writing trailer record
Reply with quote

Hi Frank,
Thanks a lot for the solution.I tried it and it's working fine..

Cheers,
Dev
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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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