IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Reading/updating files containing Spanned Records


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pleasepost

New User


Joined: 27 Sep 2005
Posts: 1

PostPosted: Tue Sep 27, 2005 2:31 am
Reply with quote

I am working with files whose individual (variable) records can span the 32K block. I cannot use the IBM utilities (except IEBGENER to copy) or COBOL to read the files, as they are limited to using QSAM access methods. I have been told that I need to code an assembler program to process these spanned-block files. Could I get some assistance as to what kind of open/get/put coding is needed to do this?

Thanks,
Patel
Back to top
View user's profile Send private message
ARJUN

New User


Joined: 16 Nov 2004
Posts: 18
Location: Chennai

PostPosted: Thu Feb 16, 2006 4:50 pm
Reply with quote

Here is a sample code for reading data from a PS file and writing data to a PS file of REC Length 80


FILEASM1 CSECT
SAVE (14,12)
BALR R12,0
USING *,12
ST R13,SAVEAREA+4

OPEN (INFILE,(INPUT),OUTFILE,(OUTPUT))
LTR R15,R15
BNZ BADOPEN
LOOP DS 0H
GET INFILE,INREC
MVC BATA,DATA
PUT OUTFILE,OUTREC
B LOOP
FINAL DS 0H
CLOSE (INFILE,,OUTFILE)
B RETURN
RETURN L R13,SAVEAREA+4
RETURN (14,12),T,RC=0
YREGS
BADOPEN WTO ' UABLE TO OPEN FILE',ROUTCDE=11,DESC=7
B RETURN
BADREAD WTO ' READ UNSUCCESSFUL ',ROUTCDE=11,DESC=7
B RETURN
BADWRITE WTO ' WRITE UNSUCCESSFUL ',ROUTCDE=11,DESC=7
B RETURN
INFILE DCB DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800,MACRF=GM, +
DDNAME=INDD,EODAD=FINAL
OUTFILE DCB DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800,MACRF=PM, +
DDNAME=OUTDD
INREC DS 0CL80
DATA DS CL80
OUTREC DS 0CL80
BATA DS CL80
SAVEAREA DS 18F
END FILEASM1
Back to top
View user's profile Send private message
winchaat

New User


Joined: 23 Mar 2005
Posts: 14

PostPosted: Thu Feb 16, 2006 6:10 pm
Reply with quote

hi

The code you given is only suitable for normal PS files.
For VSAM datasets you need to use ACB macros instead of DCB and parameters also should change accordingly



----->RAG
Back to top
View user's profile Send private message
ARJUN

New User


Joined: 16 Nov 2004
Posts: 18
Location: Chennai

PostPosted: Thu Feb 16, 2006 6:25 pm
Reply with quote

yeah,

If it is VSAM you have to use ACB and RPL macros, here is the example..

INFILE ACB AM=VSAM,DDNAME=INDD,MACRF=IN,EXLST=EXITS
RPLNAME RPL ACB=INFILE,AM=VSAM,RECLEN=80,AREA=INREC,AREALEN=80

and you have to use RPL name in GET,PUT macros instead of DCB macro name
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top