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

How can v update & delete a record from PS file in assem


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

New User


Joined: 22 Jun 2012
Posts: 3
Location: India

PostPosted: Fri Jun 22, 2012 12:25 pm
Reply with quote

Hi,

I am trying to update a record of a PS file, and in the previous posting of the same kind, they have suggested to use PUTX macro and GET macro in locate mode.

If i am trying to update empname based on empid, how do i rewrite the record in the same file.

Looking forward for some pointers. Thank you.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Jun 22, 2012 12:39 pm
Reply with quote

Search for "Updating in Place" in DFSMS Using Data Sets.
Back to top
View user's profile Send private message
Shilpa Joshi

New User


Joined: 22 Jun 2012
Posts: 3
Location: India

PostPosted: Fri Jun 22, 2012 1:57 pm
Reply with quote

*********************************************
*OPEN THE FILE IN UPDATE MODE
*********************************************
OPEN (INFIL,UPDAT)
MAINLINE EQU *
GET INFIL,RECORD
MVC INREC,RECORD
CLC EMPID,CMPID
BE UPDATE
BNE NOUPDATE
*PUT THE RECORD IN TO THE OUTPUT FILE
*********************************************
UPDATE MVC EMPNAME,=CL6'SHILPU'
TPUT INREC,L'INREC
MVC RECORD,INREC
PUTX INFIL,RECORD
B MAINLINE
NOUPDATE B MAINLINE
*AT END OF FILE, CLOSE THE FILE
*********************************************
EOF CLOSE (INFIL)
***********STANDARD EXIT*********************
L 13,SAVEAREA+4
RETURN (14,12),RC=0
*********************************************
BR 14
SAVEAREA DS 18F
INFIL DCB DDNAME=INFILE,
MACRF=GM,
BLKSIZE=800,
LRECL=80,
RECFM=FB,
DSORG=PS,
EODAD=EOF
RECORD DS CL80
INREC DS 0CL80
EMPID DS CL6
EMPNAME DS CL20
DS CL54
CMPID DC CL6'E174751'
END FILEUPDT

No errors, when i run this code, but the file is not getting updated. Could you please tell me what changes has to be done to the code?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Jun 22, 2012 2:22 pm
Reply with quote

You can use GET and PUTX macros. To use PUTX, code MACRF=(GL,PL) on the DCB macro.

You didnt do that, so you didnt read the Updating in Place part of the manual.
Back to top
View user's profile Send private message
Shilpa Joshi

New User


Joined: 22 Jun 2012
Posts: 3
Location: India

PostPosted: Fri Jun 22, 2012 2:52 pm
Reply with quote

I have changed MACRF=(GL,PL), no errors though, but nothing is getting updated in the file.

I read the updating in place, but they have used read and write. My mistake,that i didnt change MACRF to (GL,PL) in my earlier post.

Thank you.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Jun 22, 2012 6:45 pm
Reply with quote

Hello,

Do NOT multi-post the same question.

As mentioned in your other topic, it is bad design to overwrite records in a sequential file. Even if you find a way, it should NOT be used.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts DELETE SPUFI DB2 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top