Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SORT to Extract VSAM and SEQ file to SEQ file

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

New User


Joined: 03 May 2007
Posts: 27
Location: India

PostPosted: Thu Aug 13, 2009 4:59 pm    Post subject: SORT to Extract VSAM and SEQ file to SEQ file
Reply with quote

Dear Team,
Can i have a sort step to Extract for the below scenario-

Input Driver file GMIN - VSAM file of length 950
Input Sequential File - KFIN - length 300
Output Sequential File - KFOUT - length 300

1) Read GMIN sequentially
2) Read and Match against KFIN
3) If Match GMIN_ACCT = KFIN_ACCT, output the record of KFIN to KFOUT (all the fileds)
4) Else if not match, Select few fileds from GMIN record and intilaize other fields and write out to KFOUT.

Thanks in advance.
Nivasaya.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8620
Location: Back in jolly old England

PostPosted: Thu Aug 13, 2009 5:08 pm    Post subject:
Reply with quote

You will need to give more information to get a result.

RECFM of both input files, i.e. VB or FB.
The maximum record lengths of both files.
The key positions and lengths of both files, also the format of the key.
The positions and lengths of the fields to be output if there is no match.
What will the initialised data be, blanks, low values .....
Back to top
View user's profile Send private message
nivasaya

New User


Joined: 03 May 2007
Posts: 27
Location: India

PostPosted: Thu Aug 13, 2009 5:28 pm    Post subject:
Reply with quote

Please find the File Detaisl EXPAT

GMIN

ORG - PS
RECORD FORMAT - F
RECORD Length - 0

TOTAL LENGTH - 950
KEY = 22

KFIN / KFOUT

ORG - PS
RECORD FORMAT - FB
RECORD Length - 300
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: Thu Aug 13, 2009 8:33 pm    Post subject:
Reply with quote

Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
nivasaya

New User


Joined: 03 May 2007
Posts: 27
Location: India

PostPosted: Wed Aug 19, 2009 9:54 pm    Post subject:
Reply with quote

Thanks Frank, Thanks for your kind effort as always, i moved to other project, will try to get the info you have asked for from my previous project.
Currently i have a created a Cobol program for the above scenario.
The assumption is KFIN is SEC file will have the acct numbers of the GMIN is first file not any other acct # which is not present in GMIN is first file
Pseudo Code:
Open input first-file
Sec-File.

Open output out-file.

Read first-file.

Read Sec-File.

Set no-match to true.

Perform 100-Process until EOF-first-file.

100-Process.

If match

Read Sec-File at end set EOF-sec-file to true

End-if.

Set no-match to true.

Perform until sec-acct-no > first-acct-no or match or EOF-sec-file

If sec-acct-no = first-acct-no then

Set match to true

Else

Read Sec-File at end set EOF-sec-file to true

End-if

End-perform.

If match

Write out-rec from sec-rec

Else

Write out-rec from first-rec

End-if.

Read first-file at end set EOF-first-file to true.

------------------
Thanks & Regards,
Nivasaya
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Aug 19, 2009 11:20 pm    Post subject:
Reply with quote

Hello,

You need to post the requested info. . .

Show some actual input for both files and the output you want from that input. As Frank mentioned, post only the relevant fields and the processing rules.

The cobol code shows nothing about the data requirement. . .
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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us